Link Search Menu Expand Document

RegexPattern.Matches Method

Explanation Matches the specified regular expression and input string.
This method is a static method. Can be called without creating an object.

This method allows you to perform a match without having to go through the steps of creating an object.
The next two statements give similar results.

RegexPattern.Matches ("[0-9] + / [0-9] + / [0-9] +", "2011/11/28"); 
RegexPattern.Compile ("[0-9] + / [0-9] + / [0-9] +"). Matcher ("2011/11/28"). Matches ();


If you use the same regular expression repeatedly, it is more efficient to create the object with the Compile method than to call this method every time.
Call format var b = RegexPattern.Matches( regex, input [, flags [, mode ]] )
Return value $ TRUE if it matches, $ FALSE if it doesn't
Arguments String regex Regular expressions
Since Ver.5.0.1, UString type array is returned in Unicode mode
String input Matching input string
Since Ver.5.0.1, UString type array is returned in Unicode mode
integer flags Match flag
See Compile method for details.
If omitted, it is 0 (not specified).
integer mode If you want to generate the regular expression engine in Unicode mode, specify RegexPattern.Unicode
Exception Func 4 The argument value is invalid
Example of use
if (RegexPattern.Matches("[0-9]+/[0-9]+/[0-9]+", "2011/11/28")) {
    //.MessageBox("Matched");
}
    
Related item Compile, Matcher method