anyMatch()function
anyMatch(str: string, ...regexps: Matchables): boolean
| Param | Type | |
|---|---|---|
str | string | String to test against the regular expressions. required |
regexps | Matchables | - Regular expressions to match against the string. - If empty the function returns false (since none of zero provided regexps can match).- If a RegExp it is tested against the string using RegExp.test().- If a string it is simply tested against the string using === equality.- If null or undefined it is ignored. required |
| Return | |
|---|---|
boolean | true if at least one provided regular expression matches the string, otherwise false. |
At least one of the provided regular expressions matches the string.
Examples
anyMatch("abc", /z/, /b/); // true