concat-regexp
v0.0.6
Published
A function that takes a series of regular expressions and returns them in concatenated form.
Downloads
711
Maintainers
Readme
concat-regexp
concat-regexp is a function that takes a series of regular expressions (as String and/or RegExp objects) and returns them in concatenated form.
Install
$ npm install concat-regexp
Example
var concat = require('concat-regexp')
var username = 'alice'
concat(/^\/users\//, username, /\/?/, RegExp('$', 'i'))
// => /^\/users\/alice\/?$/i