contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
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:

  1. The restriction does not apply to the match parts of do scan or repeat scan actions.
  2. The restriction does not apply to 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.
  3. A pattern can check for references to data entities whose replacement text contains no characters. For example, translate sdata "" is permitted.
  4. A pattern can match a position other than content-start or content-end. This allows the use of find word-start, which is defined to be matched only once.
  5. A pattern can check for elements that have no content by using both content-start and content-end in the same pattern.

Prerequisite Concepts
     Looping constructs
   Pattern matching
   Patterns: positional
 
  Related Syntax
   content-end
   content-start
 
----

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:00:50 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.