|
NOTE: Any expression may be searched for in conjunction with a replace
operation but the replacement string will always be of fixed size.
An expression will be defined one way when given to REX to search for;
it will be defined another way when used with the `-r' or `-R'
Replace options as the replacement string. The characters
``?#{}+'' have entirely different meanings when used as part of the
syntax of a replacement string, than when used as part of the syntax of
expressions or repetition operators.
Replacement syntax is different from expression syntax, and is limited to the
following delineated rules.
- Replacement strings may just be a literal string or they may
include the ``ditto'' character ``
?''. The ditto character
will copy the character in the position specified in the
replace string from the same position in the located expression. - A decimal digit placed within curly braces ( eg:
{5} ) will place
that character of the located expression to the output. - A plus character ``
+'' will place an incrementing decimal
number to the output. One purpose of this operator is to number lines. - A ``
#'' in the replace string will cause the character in that
position to be printed in hexadecimal form. - To replace with the literal characters ``
?#{}+'' precede them
with the escapement character ``\''. - Any character in the replace string may be represented by the
hexadecimal value of that character using the following syntax:
\Xdd where ``dd'' is the hexadecimal value.
Copyright © Thunderstone Software Last updated: Wed Sep 10 11:42:21 EDT 2008
|