concat-regexp

A function that takes a series of regular expressions and returns them in concatenated form.

npm install concat-regexp
1 downloads in the last day
1 downloads in the last week
43 downloads in the last month

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.

Build status

Browser support

Install

npm install concat-regexp

Example

var concat = require('concat-regexp')

var username = 'alice'
concat(/^\/users\//, username, /\/?/, RegExp('$', 'i'))
// => /^\/users\/alice\/?$/i

License

MIT

npm loves you