REX locates and prints lines containing occurrences of regular
expressions. Beginning and end of line are the default beginning and
ending delimiters. If starting (-s
) and ending (-e
)
delimiters are specified REX will print from the beginning delimiting
expression to the ending delimiting expression. If so specified
(-p
) REX will print the expression only. If files are not
specified, standard input is used. If files are specified, the
filename will be printed before the line containing the expression,
unless the "-n
" option (don't print the filename) is used.
SYNTAX: rex [options] expression [files]
Where: options are preceded by a hyphen (-)
expressions may be contained in quotes (" ")
filename(s) comes last and can contain wildcards
OPTIONS:
-c Don't print control characters, replace with space.
-C Count the number of times the expression occurs.
-l List file names (only) that contain the expression.
-E"EX" Specify and print the ending delimiting expression.
-e"EX" Specify the ending delimiting expression.
-S"EX" Specify and print the starting delimiting expression.
-s"EX" Specify the starting delimiting expression.
-p Begin printing at the start of the expression.
-P Stop printing at the end of the expression.
-r"STR" Replace the expression with "STR" to standard output.
-R"STR" Replace the expression with "STR" to original file.
-t"Fn" Use "Fn" as the temporary file. (default: "rextmp")
-f"Fn" Read the expression(s) from the file "Fn".
-n Do not print the file name.
-O Generate "FNAME@OFFSET,LEN" entries for mm3 subfile list.
-x Translate the expression into pseudo-code (debug).
-v Print lines (or delimiters) not containing the expression.
EX
" is a REX expression.Fn
" is file name.STR
" is a replacement string.N
" is a drive name e.g.: A,B,C
...