concat-regexp

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

Usage no npm install needed!

<script type="module">
  import concatRegexp from 'https://cdn.skypack.dev/concat-regexp';
</script>

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.

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