Link Search Menu Expand Document

RegexMatcher.Reset Method

Explanation Reset the regular expression engine.

Resetting the regular expression engine initializes the current position of the Find method, the additional position of the AppendReplacement method, the match information that can be obtained using the Start, End, Group methods, and so on.

You can also set a new input string by specifying input.
Call format var ret = rm.Reset( [ input ] )
Return value Own RegexMatcher object
Arguments String input Newly set input string
If omitted, the input string will not be changed.
From Ver.5.0.1, it is treated as UString type in Unicode mode.
Exception None
Example of use
var m = RegexPattern.Compile("(Biz)/([a-zA-Z]+)").Matcher("Biz/Browser, PrintStream");
while (m.Find()) {
    print(m.Group(1), m.Group(2), "\n");
}
m.Reset("Biz/Browser, Biz/Designer");
print("----Reset----\n");
while (m.Find()) {
    print(m.Group(1), m.Group(2), "\n");
}
    
Related item