Method regexp.IsMatch(+ 1 overload)
Overload
Returns true
if string s matches this regular expression.
public bool IsMatch(string s, Range? range = null, RXMatchFlags matchFlags = 0)
Parameters
s (string)
Subject string.
If |
range (Range?)
Start and end offsets in the subject string. If |
matchFlags (RXMatchFlags)
Options. The same options also can be set in regexp constructor's flags. Constructor's flags and matchFlags are added, which means that matchFlags cannot unset flags set by constructor. |
Returns
bool
|
Exceptions
ArgumentOutOfRangeException
Invalid range. |
AuException
The PCRE API function pcre2_match failed. Unlikely. |
Remarks
This function is similar to System.Text.RegularExpressions.Regex.IsMatch.
Examples
var s = "one two22 three333 four";
var x = new regexp(@"\b(\w+?)(\d+)\b");
print.it(x.IsMatch(s));
Overload(top)
Returns true
if string s matches this regular expression.
public bool IsMatch(ReadOnlySpan<char> s, Range? range = null, RXMatchFlags matchFlags = 0)
Parameters
s (ReadOnlySpan<char>)
Subject string.
If |
range (Range?)
Start and end offsets in the subject string. If |
matchFlags (RXMatchFlags)
Options. The same options also can be set in regexp constructor's flags. Constructor's flags and matchFlags are added, which means that matchFlags cannot unset flags set by constructor. |
Returns
bool
|
Exceptions
ArgumentOutOfRangeException
Invalid range. |
AuException
The PCRE API function pcre2_match failed. Unlikely. |
Remarks
This function is similar to System.Text.RegularExpressions.Regex.IsMatch.
Examples
var s = "one two22 three333 four";
var x = new regexp(@"\b(\w+?)(\d+)\b");
print.it(x.IsMatch(s));