Skip to content

Instantly share code, notes, and snippets.

@lowellk
Created January 25, 2016 21:11
Show Gist options
  • Save lowellk/85cd470ab04c71c46949 to your computer and use it in GitHub Desktop.
Save lowellk/85cd470ab04c71c46949 to your computer and use it in GitHub Desktop.
Utility for making regexes in JS more readable.
function makeRegex() {
var argsArray = Array.prototype.slice.call(arguments);
return new RegExp(argsArray.map(function (r) {
return r.source
}).join(''));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment