strmatch

Matches the target string with the regular expression.

Format

strmatch <target string> <string with regular expression>

Remarks

Supports Oniguruma Regular Expressions.
This command searches the <target string> with the <string with regular expression>.
The "strmatch" command returns one of the following values in the system variable "result":

Value Meaning
0 Not matched.
1 Matched offset(1origin).

The first matched pattern is stored in the system variable "matchstr".
Group matched patterns of regular expressions are stored in 9 system variables from "groupmatchstr1" to "groupmatchstr9".

Example

strmatch 'Tera Term' '(UTF-[789]).*'
int2str s result
messagebox s 'result'
messagebox matchstr 'matchstr'
messagebox groupmatchstr1 'groupmatchstr1'
messagebox groupmatchstr2 'groupmatchstr2'
messagebox groupmatchstr3 'groupmatchstr3'
messagebox groupmatchstr4 'groupmatchstr4'