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 4 spaces:
    >>\n\n=\space\P{4}!\n\n\space\space\space\space+\F\n\n=\space{4}

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

Copyright © Thunderstone Software     Last updated: Apr 11 2022
Copyright © 2022 Thunderstone Software LLC. All rights reserved.