parsePatternOrRegExp
Reads a setting that is either a regular expression or a glob: /source/flags is a regular
expression when every flag is valid (d, g, i, m, s, u, v, y), anything else is
a glob. For font substitution rules, ignore lists, filters. Note that /usr/lib/img is the
regular expression usr/lib with the flags img: for paths, use globToRegExp.
Available since v3.1.10
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pattern | string | A `/source/flags` regular expression or a glob |
options | MatchGlobOptions | How to read a glob — see MatchGlobOptions. A regular expression keeps its own flags |
Returns
Section titled “Returns”RegExp — The RegExp
Examples
Section titled “Examples”Glob or regular expression
Section titled “Glob or regular expression”A /source/flags string is a regular expression; anything else is a glob.
Related Types
Section titled “Related Types”MatchGlobOptions
Section titled “MatchGlobOptions”Options for matchGlob and parsePatternOrRegExp.
