| Syntax 
   repeat scan string-expression
     (match pattern condition?
        local-declaration*
        action*)+
  again
 Purpose
 
 Scans a string-expression for specified patterns in the same manner as the do scanaction. When a match is found, the corresponding actions are performed. However, the string is then scanned again, from the first character to the right of the part matched by the previous iteration. This process continues until one of the following conditions has been met:
 The entire string-expression has been "consumed".
The unused portion fails to match any pattern (or satisfy its associated condition, if specified).
The repeat scanis explicitly terminated with anexitorhalt(or with thereturnif therepeat scanis in a function).
 Note that an elsephrase may not be used in arepeat scanaction. If an "if all else fails" (if no other case applies) case is required, amatch anyalternative can be used withexitat the end to terminate the loop. In repeat scan, patterns that can match zero characters are given special treatment. Zero characters cannot be matched successfully twice in a row. OmniMark enforces this by interpreting a match of zero characters as successful only if the previous iteration matched one or more characters. |