Skip to content

Cm5StringStream.match method

Cm5StringStream › match

Unofficial

Matches against a string or regular expression pattern.

Signature:

match(pattern: string, consume?: boolean | undefined, caseFold?: boolean | undefined): boolean

Parameters:

ParameterTypeDescription
patternstringThe string pattern to match.
consume?boolean | undefinedWhether to advance the stream on match.
caseFold?boolean | undefinedWhether to match case-insensitively.

Returns: booleantrue if the pattern matched.


Unofficial

Matches against a regular expression pattern.

Signature:

match(pattern: RegExp, consume?: boolean | undefined): null | string[]

Parameters:

ParameterTypeDescription
patternRegExpThe regular expression to match.
consume?boolean | undefinedWhether to advance the stream on match.

Returns: null | string[]The match array, or null if no match.