12 lines
329 B
JavaScript
12 lines
329 B
JavaScript
/**
|
|
* Build RegExp object from an array
|
|
* of multiple/multi-line regexp parts
|
|
*
|
|
* @param {string[]} parts
|
|
* @param {string} flags
|
|
* @return {object} - RegExp object
|
|
*/
|
|
export default function multilineRegexp(parts, flags) {
|
|
var regexpAsStringLiteral = parts.join('');
|
|
return new RegExp(regexpAsStringLiteral, flags);
|
|
} |