node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

concat-regexp

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