evaluates to true, if s is a string starting with a capital letter.
In regular expressions, parenthesis ``(..)'' can be used to mark certain parts of the expression that correspond to sub-strings of the left-hand-side string, if the pattern matching has been successful. For that, Xasm provide a special form of regular expression pattern matching: If the left-hand-term of a pattern matching expression evaluates to a string object s and the right-hand-term evaluates to a tuple the first argument of which represents a string object r and the remaining arguments are pattern matching variables , the string s is matched against the regular expression r and the sub-matches are put into the pattern matching variables , if the match has been successful.
In this example, the regular expression contains two sub-matches, the
first one matches the string "A"
, the second one the string
"nyString"
.The submatches can be accessed in the then-part of the conditional
rules as values of the pattern matching variables &hd and &tl.