<gh_stars>0
\#is-\/regex \textsuperscript{\href{https://npmjs.org/package/is-regex}{\tt }}

\href{https://travis-ci.org/ljharb/is-regex}{\tt } \href{https://david-dm.org/ljharb/is-regex}{\tt } \href{https://david-dm.org/ljharb/is-regex#info=devDependencies}{\tt } \mbox{[}\mbox{]}\mbox{[}license-\/url\mbox{]} \href{http://npm-stat.com/charts.html?package=is-regex}{\tt }

\href{https://npmjs.org/package/is-regex}{\tt }

\href{https://ci.testling.com/ljharb/is-regex}{\tt }

Is this value a JS regex? This module works cross-\/realm/iframe, and despite E\+S6 @to\+String\+Tag.

\subsection*{Example}


\begin{DoxyCode}
var isRegex = require('is-regex');
var assert = require('assert');

assert.notOk(isRegex(undefined));
assert.notOk(isRegex(null));
assert.notOk(isRegex(false));
assert.notOk(isRegex(true));
assert.notOk(isRegex(42));
assert.notOk(isRegex('foo'));
assert.notOk(isRegex(function () \{\}));
assert.notOk(isRegex([]));
assert.notOk(isRegex(\{\}));

assert.ok(isRegex(/a/g));
assert.ok(isRegex(new RegExp('a', 'g')));
\end{DoxyCode}


\subsection*{Tests}

Simply clone the repo, {\ttfamily npm install}, and run {\ttfamily npm test} 