Replacement expressions are used to substitute text in conjunction with Tagged Regular Expressions, when using the Replace command.
Expression | Definition |
---|---|
& | Substitute the text matching the entire search pattern. |
\0 to \9 | Substitute the text matching tagged expression 0 through 9. \0 is equivalent to &. |
\f | Substitute a page break (form feed). |
\i<expression> | Substitute a sequence number. |
\n | Substitute a newline. |
\p | Substitute the contents of the clipboard. |
\t | Substitute a tab. |
\xdd | Substitute the character with hex code dd (must be 2 hex digits, excluding 00). |
\u | Force the next substituted character to be in upper case. |
\l | Force the next substituted character to be in lower case. |
\U | Force all subsequent substituted characters to be in upper case. |
\L | Force all subsequent substituted characters to be in lower case. |
\E or \e | Turns off previous \U or \L. |
To substitute a literal \ or &, use \\ and \&.
Beware of replacing a pattern that is matched with a regular expression that can optionally match nothing, such as ".?" or "a*". In these degenerate cases, TextPad can go into a loop, until the line becomes too long.