Lua API
On this page

Match

Inherits from

Tip

This is a builtin dotnet type. The documentation and api interface are generated from dotnet source files.

Represents the results from a single regular expression match.

Fields:

Captures CaptureCollection

read only

Gets a collection of all the captures matched by the capturing group, in innermost-leftmost-first order (or innermost-rightmost-first order if the regular expression is modified with the RegexOptions.RightToLeft option). The collection may have zero or more items.

Empty Match

staticread only

Gets the empty group. All failed matches return this empty match.

Groups GroupCollection

read only

Gets a collection of groups matched by the regular expression.

Index number

read only

The position in the original string where the first character of the captured substring is found.

Length number

read only

Gets the length of the captured substring.

Name string

read only

Returns the name of the capturing group represented by the current instance.

Success boolean

read only

Gets a value indicating whether the match is successful.

Value string

read only

Gets the captured substring from the input string.

Methods:

GetPropertyKeys() : string[]

Returns a list of strings of all public property / field names. Useful for reflection on UserData in lua scripts

Returns:string[]

NextMatch() : Match

Returns a new Match object with the results for the next match, starting at the position at which the last match ended (at the character after the last matched character).

Returns:Match

Result(replacement: string) : string

Returns the expansion of the specified replacement pattern.

Parameters:
NameTypeDefaultSummary
replacementstring

The replacement pattern to use.

Returns:string

Synchronized(inner: Match) : Match

static

Returns a Match instance equivalent to the one supplied that is suitable to share between multiple threads.

Parameters:
NameTypeDefaultSummary
innerMatch

A regular expression match equivalent to the one expected.

Returns:Match

ToString() : string

Retrieves the captured substring from the input string by calling the Capture.Value property.

Returns:string