REX Description

REX stands for Regular EXpression Pattern Matcher. REX gives you the ability to match ranges of characters, symbols, and numbers, as well as to selectively designate how many of each you wish to look for. By combining such pattern designations into what is called a "Regular Expression" you can look for such things as phone numbers, chemical formulas, social security numbers, dates, accounting amounts, names entered in more than one form, ranges of years, text formatting patterns, and so on.

As REX is also supplied with the Texis package as a separate utility, the next chapter is devoted to a detailed account of all of REX's syntax and features, and can be studied to learn how to designate complex regular expressions and how to use it to accomplish tasks outside a normal search envirnoment.

While a complete understanding is not required for the casual searcher, the better you understand how to describe expressions using REX syntax, the more you will be able to make use of it, in or outside Texis or a Metamorph search application.

REX can be used in the following ways, where the same rules of syntax apply to all:

  • REX expressions can be entered as query items, following a forward slash /.

  • REX expressions can be entered in a query following a w/ designation to dynamically define a special pattern to delimit your Metamorph query.

  • REX expressions can be used as part of functions in a Vortex program, in the use of the functions rex and sandr (search and replace) and the start and end delimiter expressions sdexp and edexp.

  • REX can be used as a stand-alone utility outside of a Texis or Metamorph application, to do such things as change file formats with Search and Replace, search through excerpted report files to pull out specific items of interest, or to create lists of headers.

While this is not intended as a complete list, by way of example, some of the ranges of characters one can delineate with REX's syntax follow.

\alphaxx = Matches any alpha character; [A-Z] or [a-z].  
\alpha   > Matches any alpha character; [A-Z] or [a-z].    
\upper   > Matches any upper case alpha character; [A-Z].  
\lower   > Matches any lower case alpha character; [a-z].  
\digit   > Matches any numeric character; [0-9].           
\alnum   > Any alpha or any numeric character; [A-Z] or [a-z] or [0-9].  
\space   > Any space character; [space,return,linefeed,tab,formfeed,vertical-tab].  
\punct   > Any punctuation; [not control and not space and not alphanumeric].  
\print   > Any printable character; [all of the above].  
\cntrl   > Any control character.   
\R       > Respect case.            
\I       > Ignore case.             
\Xnn     > Matches hexadecimals.


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