hash-regex
Converts an array of strings to a regular expression of hashtags
Install
$ npm install --save hash-regex
Usage
const hashRegEx = ; const regEx1 = ;//=> /#one|#two|#three/gi // strings can have a hash sign, or not. Override the default flagsconst regEx2 = ;//=> /#withhash|#withouthash/m
API
hashRegEx(array,[options])
array
Type: Array
Required
The array of strings you want to convert to a RegExp of hashes. Strings can begin with hash or not.
options
flags
Type: String
Default: gi
The RegExp flags you want to use.
License
MIT © Michael Wuergler