lowellk
1/25/2016 - 9:11 PM

Utility for making regexes in JS more readable.

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(''));
}