\begin{quote}
The best regular expression (regex) for matching hex color values from string. \end{quote}
\href{https://codeclimate.com/github/regexps/hex-color-regex}{\texttt{ }} \href{https://github.com/feross/standard}{\texttt{ }} \href{https://travis-ci.org/regexhq/hex-color-regex}{\texttt{ }} \href{https://codeclimate.com/github/regexps/hex-color-regex}{\texttt{ }} \href{https://david-dm.org/regexhq/hex-color-regex}{\texttt{ }}\hypertarget{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11602}{}\doxysection{Install}\label{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11602}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm i hex-\/color-\/regex -\/-\/save}
\DoxyCodeLine{npm test }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11603}{}\doxysection{Usage}\label{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11603}
\begin{quote}
For more use-\/cases see the \href{./test.js}{\texttt{ tests}} \end{quote}

\begin{DoxyItemize}
\item {\ttfamily \mbox{[}opts\mbox{]}} $\ast$$\ast$\{Object\}$\ast$$\ast$ pass {\ttfamily strict\+: true} for strict mode
\item {\ttfamily return} $\ast$$\ast$\{Reg\+Exp\}$\ast$$\ast$
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var hexColorRegex = require('hex-\/color-\/regex')}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('\#f3f\}') //=> true}
\DoxyCodeLine{hexColorRegex(\{strict: true\}).test('\#f3f\}') //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('foo \#f3f bar') //=> true}
\DoxyCodeLine{hexColorRegex(\{strict: true\}).test('foo \#f3f bar') //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('\#a54f2c\}') //=> true}
\DoxyCodeLine{hexColorRegex(\{strict: true\}).test('\#a54f2c\}') //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('foo \#a54f2c bar') //=> true}
\DoxyCodeLine{hexColorRegex(\{strict: true\}).test('foo \#a54f2c bar') //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('\#ffff') //=> false}
\DoxyCodeLine{hexColorRegex().test('ffff') //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('\#fff') //=> true}
\DoxyCodeLine{hexColorRegex().test('fff') //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('\#4g1') //=> false}
\DoxyCodeLine{hexColorRegex().test('4g1') //=> false}
\DoxyCodeLine{hexColorRegex().test('\#zY1') //=> false}
\DoxyCodeLine{hexColorRegex().test('zY1') //=> false}
\DoxyCodeLine{hexColorRegex().test('\#7f68ZY') //=> false}
\DoxyCodeLine{hexColorRegex().test('7f68ZY') //=> false}
\DoxyCodeLine{hexColorRegex().test('ffffff') //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('\#afebe3') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#AFEBE3') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#3cb371') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#3CB371') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#556b2f') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#556B2F') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#708090') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#7b68ee') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#7B68EE') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#eeeeee') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#ffffff') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#111111') //=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().test('\#afe') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#AF3') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#3cb') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#3CB') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#b2f') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#5B2') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#708') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#68e') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#7AF') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#777') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#FFF') //=> true}
\DoxyCodeLine{hexColorRegex().test('\#fff') //=> true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11604}{}\doxysection{Matching groups}\label{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11604}

\begin{DoxyItemize}
\item {\ttfamily match\mbox{[}0\mbox{]}} hex value with hash -\/ {\ttfamily \#f3f3f3}
\item {\ttfamily match\mbox{[}1\mbox{]}} hex value without the hash -\/ {\ttfamily f3f3f3}
\end{DoxyItemize}

{\bfseries{Example}}


\begin{DoxyCode}{0}
\DoxyCodeLine{hexColorRegex().exec('foo \#fff bar')}
\DoxyCodeLine{//=> [ '\#fff', 'fff', index: 4, input: 'foo \#fff bar' ]}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex(\{strict: true\}).exec('foo \#fff bar')}
\DoxyCodeLine{//=> null}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex().exec('foo \#f3f3f3 bar')}
\DoxyCodeLine{//=> [ '\#f3f3f3', 'f3f3f3', index: 4, input: 'foo \#f3f3f3 bar' ]}
\DoxyCodeLine{}
\DoxyCodeLine{hexColorRegex(\{strict: true\}).exec('foo \#f3f3f3 bar')}
\DoxyCodeLine{//=> null }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11605}{}\doxysection{Related}\label{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11605}

\begin{DoxyItemize}
\item \href{https://github.com/tunnckocore/benz}{\texttt{ benz}}\+: Compose your control flow with absolute elegance. Support async/await, callbacks, thunks, generators, promises, observables, child… \href{https://github.com/tunnckocore/benz}{\texttt{ more}}
\item \href{https://github.com/tunnckocore/is-hexcolor}{\texttt{ is-\/hexcolor}}\+: Check that given value is valid hex color, using {\ttfamily hex-\/color-\/regex} -\/ the best regex for… \href{https://github.com/tunnckocore/is-hexcolor}{\texttt{ more}}
\item \href{https://github.com/tunnckocore/is-ansi}{\texttt{ is-\/ansi}}\+: Check that given string contain ANSI color codes, without CLI
\item \href{https://github.com/tunnckocore/is-missing}{\texttt{ is-\/missing}}\+: Check that given {\ttfamily name} or {\ttfamily user/repo} exists in npm registry or in github as user… \href{https://github.com/tunnckocore/is-missing}{\texttt{ more}}
\item \href{https://github.com/tunnckocore/is-kindof}{\texttt{ is-\/kindof}}\+: Check type of given javascript value. Support promises, generators, streams, and native types. Thin wrapper… \href{https://github.com/tunnckocore/is-kindof}{\texttt{ more}}
\item \href{https://github.com/tunnckocore/is-typeof-error}{\texttt{ is-\/typeof-\/error}}\+: Check that given value is any type of error and instanceof Error
\item \href{https://github.com/tunnckocore/is-async-function}{\texttt{ is-\/async-\/function}}\+: Check that given function is async (callback) function or not. Trying to guess that based… \href{https://github.com/tunnckocore/is-async-function}{\texttt{ more}}
\item \href{https://github.com/tunnckocore/kind-error}{\texttt{ kind-\/error}}\+: Correct inheriting from {\ttfamily Error}. Supports constructing from an object of properties -\/ focused on assertion.
\item \href{https://github.com/tunnckocore/kind-of-extra}{\texttt{ kind-\/of-\/extra}}\+: Extends {\ttfamily kind-\/of} type check utility with support for promises, generators, streams and errors. Like {\ttfamily kindof(Promise.\+resolve(1))… \mbox{[}more\mbox{]}(\href{https://github.com/tunnckocore/kind-of-extra}{\texttt{ https\+://github.\+com/tunnckocore/kind-\/of-\/extra}})}
\item {\ttfamily \mbox{[}vez\mbox{]}(\href{https://github.com/tunnckocore/vez}{\texttt{ https\+://github.\+com/tunnckocore/vez}})\+: Middleware composition at new level. Ultimate alternative to}ware{\ttfamily ,}plugins{\ttfamily ,}koa-\/compose{\ttfamily and}composition\`{} packages. Allows… \href{https://github.com/tunnckocore/vez}{\texttt{ more}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11606}{}\doxysection{Contributing}\label{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11606}
Pull requests and stars are always welcome. For bugs and feature requests, \href{https://github.com/regexhq/hex-color-regex/issues/new}{\texttt{ please create an issue}}. ~\newline
 But before doing anything, please read the \mbox{\hyperlink{md_sfcode_node_modules_hex_color_regex_CONTRIBUTING}{CONTRIBUTING.md}} guidelines.\hypertarget{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11607}{}\doxysection{$<$a href=\char`\"{}http\+://j.\+mp/1st\+W47\+C\char`\"{}$>$\+Charlike Make Reagent$<$/a$>$ $<$a href=\char`\"{}https\+://github.\+com/tunncko\+Core/messages\char`\"{}$>$$<$img src=\char`\"{}https\+://img.\+shields.\+io/badge/send\%20me-\/message-\/green.\+svg\char`\"{} alt=\char`\"{}new message to charlike\char`\"{}/$>$$<$/a$>$ $<$a href=\char`\"{}http\+://webchat.\+freenode.\+net/?channels=charlike\char`\"{}$>$$<$img src=\char`\"{}https\+://img.\+shields.\+io/badge/freenode-\/\%23charlike-\/5654a4.\+svg\char`\"{} alt=\char`\"{}freenode \#charlike\char`\"{}/$>$$<$/a$>$}\label{md_sfcode_node_modules_hex_color_regex_README_autotoc_md11607}
\href{http://www.tunnckocore.tk}{\texttt{ }} \href{https://keybase.io/tunnckocore}{\texttt{ }} \href{https://www.npmjs.com/~tunnckocore}{\texttt{ }} \href{https://twitter.com/tunnckoCore}{\texttt{ }} \href{https://github.com/tunnckoCore}{\texttt{ }} 