Method ExtString.RxMatch(+ 2 overloads)
Overload
Returns true
if this string matches PCRE regular expression rx.
Gets match info as RXMatch.
public static bool RxMatch(this string t, string rx, out RXMatch result, RXFlags flags = 0, Range? range = null)
Parameters
t (string)
This string. If |
rx (string)
Regular expression. Cannot be |
result (RXMatch)
Receives match info. |
flags (RXFlags)
Options. Default 0. Flag UTF is implicitly added if rx contains non-ASCII characters and there is no flag NEVER_UTF. |
range (Range?)
Start and end offsets in the subject string. If |
Returns
bool
|
Exceptions
ArgumentOutOfRangeException
Invalid range. |
ArgumentException
Invalid regular expression. |
AuException
Failed (unlikely). |
Remarks
More info and examples: regexp.
Overload(next)
Returns true
if this string matches PCRE regular expression rx.
Gets whole match or some group, as string.
public static bool RxMatch(this string t, string rx, int group, out string result, RXFlags flags = 0, Range? range = null)
Parameters
t (string)
This string. If |
rx (string)
Regular expression. Cannot be |
group (int)
Group number (1-based index) of result. If 0 - whole match. See also regexp.GetGroupNumberOf. |
result (string)
Receives the match value. |
flags (RXFlags)
Options. Default 0. Flag UTF is implicitly added if rx contains non-ASCII characters and there is no flag NEVER_UTF. |
range (Range?)
Start and end offsets in the subject string. If |
Returns
bool
|
Exceptions
ArgumentOutOfRangeException
Invalid group or range. |
ArgumentException
Invalid regular expression. |
AuException
Failed (unlikely). |
Remarks
More info and examples: regexp.
Overload(top)
Returns true
if this string matches PCRE regular expression rx.
Gets whole match or some group, as index and length.
public static bool RxMatch(this string t, string rx, int group, out RXGroup result, RXFlags flags = 0, Range? range = null)
Parameters
t (string)
This string. If |
rx (string)
Regular expression. Cannot be |
group (int)
Group number (1-based index) of result. If 0 - whole match. See also regexp.GetGroupNumberOf. |
result (RXGroup)
Receives match info. |
flags (RXFlags)
Options. Default 0. Flag UTF is implicitly added if rx contains non-ASCII characters and there is no flag NEVER_UTF. |
range (Range?)
Start and end offsets in the subject string. If |
Returns
bool
|
Exceptions
ArgumentOutOfRangeException
Invalid group or range. |
ArgumentException
Invalid regular expression. |
AuException
Failed (unlikely). |
Remarks
More info and examples: regexp.