createRegExpAll()function

createRegExpAll(patterns: Iterable<PossibleRegExp> & NotString, flags?: string): RegExp
ParamType
patternsIterable<PossibleRegExp> & NotString
The regular expressions or string sources to combine. required
flagsstring
The flags to use when creating the combined RegExp.
Return
RegExp
A RegExp that matches only if all of the provided expressions match.

Create a regular expression that matches all of a list of other expressions.

  • If the list is empty the returned expression matches everything (ALWAYS_REGEXP).

Examples

createRegExpAll(["abc", "def"]); // /^(?=.*?(?:abc))(?=.*?(?:def))/