swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
operator  

matches

 
 

Syntax

string-expression matches pattern


Purpose

The matches operator provides a general way to test the contents of a string expression by matching it against an OmniMark pattern. When only one pattern is being tried, the most convenient way to do this is often by using matches.

The matches operator takes two operands: the string-expression being scanned and the pattern against which it is matched.

The pattern any** is used when the pattern can appear anywhere in the string; otherwise, the pattern must appear at the beginning of the string-expression for a match to succeed.

Parentheses must be used to enclose the pattern if it consists of more than one component.

If there is more than one pattern to scan, it is often easier and more efficient to use do scan.

Usage example:

  do when attribute codes matches any** (word-start "OK" word-end)
        ...
  done

    Related Syntax
   do scan
 
Related Concepts
   Pattern matching functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.