Check if a string is a regular expression
- The string must include the opening & closing forward slash (
/
). - Regular expression flags, e.g.
gim
, may be optionally included.
Install
$ npm install is-regexp-string
Usage
const isRegexpString = ; // The forward slashes of the regular expression are *required*;//=> true ;//=> false // Valid RegExp, but matches everything;//=> true
Related
- is-regexp - Check if a value is a regular expression
License
MIT