Replacement Expressions
Examples
These replacement
expressions are examples for replacing text in Finders Keepers™.
These are used to replace text found by searching with regular
expressions. You must search files with regular expressions for the
replacement expressions to work.
Please note, however, that there are other
ways to search files and replace text if you do not want to use regular
expressions and replacement expressions.
Regular Expression
|
Replacement Expression
|
Result
|
{Windows}{ 9[58]}
|
\1 2000
|
Replaces an occurrence
of “Windows 95” or “Windows 98” with “Windows 2000”.
The “\1” in the replacement expression puts the sub-expression
#1, “{Windows}”, into the replacement text and adds the literal “
2000”. The “95” or “98” in the found text is discarded in the replacement text.
|
{Windows}{ 9[58]}
|
Wash\2 \1
|
Replaces “Windows
95” with “Wash 95 Windows”. Replaces
“Windows 98” with “Wash 98 Windows”.
The “\2” refers to the found text that matches the second
sub-expression, “{ 9[58]}”.
|
{his}{.+}{[kl]eg}
|
\1\2peg
|
Replaces “his wooden
keg” or “his wooden leg” with “his wooden peg”.
|
|