|
|||||
Patterns: avoiding loops | |||||
Prerequisite Concepts | Related Syntax |
OmniMark does not accept patterns that could be matched repeatedly at the same point in a document. For example, if the rule header find ""
were permitted, this rule would always be selected, and the program would go on forever.
A similar difficulty arises with find letter*
, which matches zero characters if the next character is not a letter. To avoid this situation, OmniMark generally requires selected patterns to match at least one character or a positional pattern other than content-start
or content-end
.
There are several exceptions to this general principle:
match
parts of do scan
or repeat scan
actions.
processing-instruction
rules. This is because the rule processes the whole processing instruction, and not just the characters inside that are matched by the pattern.
translate sdata ""
is permitted.
content-start
or content-end
. This allows the use of find word-start
, which is defined to be matched only once.
content-start
and content-end
in the same pattern.
Prerequisite Concepts Looping constructs Pattern matching Patterns: positional |
Related Syntax content-end content-start |
---- |