do scan string-expression (match pattern condition? local-declaration* action*)+ (else local-declaration* action*)? done
This scanning action specifies a number of
match alternatives, each of which contains a sequence of actions to be performed if the value of the specified string expression matches the given pattern. The
else phrase is optional. Only one
else phrase may be used in a
do scan action.
The actions in a
match alternative are performed if the pattern matches all or part of the string expression. Each time a
match alternative is tried, the pattern matching begins again at the beginning of the data to be scanned.
match alternative specifies a condition, then the condition must also be satisfied before the actions in that alternative will be executed.