You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
329 B
12 lines
329 B
2 years ago
|
/**
|
||
|
* 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);
|
||
|
}
|