Regex
Tip
This is a builtin dotnet type. The documentation and api interface are generated from dotnet source files.
Represents an immutable regular expression.
Fields:
Options RegexOptions
Gets the options that were passed into the Regex constructor.
RightToLeft boolean
Gets a value that indicates whether the regular expression searches from right to left.
Constructors:
New(pattern: string) :
Initializes a new instance of the Regex class for the specified regular expression.
Name | Type | Default | Summary |
pattern | string | The regular expression pattern to match. |
New(pattern: string, options: RegexOptions) :
Initializes a new instance of the Regex class for the specified regular expression, with options that modify the pattern.
Name | Type | Default | Summary |
pattern | string | The regular expression pattern to match. | |
options | RegexOptions | A bitwise combination of the enumeration values that modify the regular expression. |
New(pattern: string, options: RegexOptions, matchTimeout: TimeSpan) :
Initializes a new instance of the Regex class for the specified regular expression, with options that modify the pattern and a value that specifies how long a pattern matching method should attempt a match before it times out.
Name | Type | Default | Summary |
pattern | string | The regular expression pattern to match. | |
options | RegexOptions | A bitwise combination of the enumeration values that modify the regular expression. | |
matchTimeout | TimeSpan | A time-out interval, or InfiniteMatchTimeout to indicate that the method should not time out. |
Methods:
Escape(str: string) : string
Escapes a minimal set of characters (\, *, +, ?, |, {, [, (,), ^, $, ., #, and white space) by replacing them with their escape codes. This instructs the regular expression engine to interpret these characters literally rather than as metacharacters.
Name | Type | Default | Summary |
str | string | The input string that contains the text to convert. |
GetGroupNames() : string
Returns an array of capturing group names for the regular expression.
GetGroupNumbers() : number
Returns an array of capturing group numbers that correspond to group names in an array.
GetPropertyKeys() : string[]
Returns a list of strings of all public property / field names. Useful for reflection on UserData in lua scripts
GroupNameFromNumber(i: number) : string
Gets the group name that corresponds to the specified group number.
Name | Type | Default | Summary |
i | number | The group number to convert to the corresponding group name. |