createRegexMatcher
createMatcher with every string read as the source of a regular expression, without
slashes or flags ('^(Home|Login)$'): for a setting documented as “a regular expression”.
Available since v3.1.5
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pattern | MatcherPattern | readonly MatcherPattern[] | A pattern, or an array of patterns and `!` exclusions |
options | Omit<MatcherOptions, "syntax"> | Case sensitivity (adds the `i` flag when `false`) |
Returns
Section titled “Returns”function — A function telling whether a string matches
Examples
Section titled “Examples”A setting documented as a regular expression
Section titled “A setting documented as a regular expression”The string is the source, without slashes.
Ignore case
Section titled “Ignore case”caseSensitive: false adds the i flag.
Related Types
Section titled “Related Types”MatcherOptions
Section titled “MatcherOptions”Options for createMatcher and createSafeMatcher.
MatcherPattern
Section titled “MatcherPattern”One pattern accepted by createMatcher: a string (read according to
MatcherOptions.syntax), a RegExp, or a predicate of your own.
