?#{}+\
" are special. To use them
literally, precede them with the escapement character
"\
'.?
'. The ditto character will
copy the character in the position specified in the
replace-string from the same position in the located expression.{5}
)
will place that character of the located expression to the output.\
" followed by a decimal number will place that
subexpression to the output. Subexpressions are numbered starting at
1.\&
" will place the entire expression match
(sans \P
and \F
portions) to the output. This escape
was added in Texis version 7.06.+
" will place an incrementing decimal number
to the output. One purpose of this operator is to number lines.#
" followed by a number will cause the numbered
subexpression to be printed in hexadecimal form.\x
hh where hh is the hexadecimal value.
EXAMPLE<$data = "Roses are red" "Violets are blue">
<$expr = "blue" "red">
<$replace = "you" "dead">
<sandr $expr $replace $data>
<LOOP $ret>
$ret
</LOOP>
The output would be:
Roses are dead
Violets are you
CAVEATS
The sandr
function was added Aug. 23 1996.
The replacements occur in the order of values in $expr
, so
a later $expr
might match a previous $replace
value.
SEE ALSOrex
, split