Skip to content

Cm5StringStream.match method

Cm5StringStream › match

Unofficial

Matches against a string or regular expression pattern.

Signature:

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

Parameters:

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

Returns: boolean — true if the pattern matched.


Unofficial

Matches against a regular expression pattern.

Signature:

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

Parameters:

ParameterTypeDescription
patternRegExpThe regular expression to match.
consume?booleanWhether to advance the stream on match.

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