Examples of Some Useful REX Expressions

  • To locate phone numbers:
    1?\space?(?\digit\digit\digit?)?[\-\space]?\digit{3}-\digit{4}

  • To locate social security numbers:
    \digit{3}-\digit{2}-\digit{4}

  • To locate text between parentheses:
    (=[^()]+)      <- without direction specification
         or
    >>(=!)+)       <- with direction specification

  • To locate paragraphs delimited by an empty line and 5 spaces:
    >>\n\n\space{5}=!\n\n\space{5}+\n\n\space{5}

  • To locate numbers in scientific notation; e.g., "-3.14 e -21":
    [+\-]?\space?\digit+\.?\digit*\space?e?\space?[+\-]?\space?\digit+

You can formulate patterns of things to look for using these types of patterns. You can look for a REX expression by itself, or in proximity to another search item. Such a search could combine a REX expression in union with an intelligent concept search. For example, you could enter the following in a query input box:

"/\digit{2}%" measurement

The REX expression indicates 2 occurrences of any digit followed by a percent sign. "Measurement" will be treated as an English root word with its list of equivalences, and passed to PPM.

In this search, Metamorph will look for an intersection of both elements inside the specified delimiters, and may come up with a hit such as:

They estimated that only 65% of the population showed up to vote.

where "estimated" was associated with "measurement", and "65%" was associated with the pattern "\digit{2}%".


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.