IFREGEX - Branch to label if a regular express matched in a master string |
Top Previous Next |
This script command attempts to match a regular expression with a specified master string and branches to [ label ] if it is matched or if using the IFNREGEX variant it branches if it is not matched.
Use the alternate IFREGEXI or IFNREGEXI command to perform the same comparison but to ignore case during the comparison. It also updates the %regex variables. %regex will be equal to the number of matched sub expressions while the %regex[0] will be set to the match found. The sub-expressions can be accessed with %regex[n] where n is the sub-expression.
Consider the following simple example with one sub-expression that results in a branch to the specified label.
SET master_string = "abcdefg" SET pattern = "a(.)c" IFREGEX master_string pattern GOTO pattern_matched
After the branch to the pattern_matched label the following variables will be set in this case:
Related command(s): IFSTRCMP, IFNSTRCMP, IFSUBSTR, UPPER, LOWER
|