create-word-boundary-regex
v1.0.0
Published
Helper for create a word boundary regex based in a collection
Readme
create-word-boundary-regex
Helper for create a word boundary regex based in a collection
Install
$ npm install create-word-boundary-regex --saveUsage
const createWordBoundaryRegex = require('create-word-boundary-regex')
const regex = createWordBoundaryRegex([
'hello',
'world'
])
console.log(regex)
// => /\bhello\b|\bworld\b/iAPI
createWordBoundaryRegex(collection, [flags])
collection
Required
Type: Array
Collection of String for create the regex.
flags
Type: String
Default: i
Regex flags for create the regex.
License
MIT © Kiko Beats.
