MACROMEDIA COLDFUSION STUDIO 4.5-USING COLDFUSION STUDIO Use Manual page 124

For windows 95/98/nt4/2000
Table of Contents

Advertisement

116
Using back references
HomeSite supports back referencing, which allows you to match text in previously
matched sets of parentheses. You can use a slash followed by a digit n (\n) to refer to
the n
One example of how you can use back references is searching for doubled words, for
example, to find instances of "is is" or "the the" in text. The following example shows
the syntax you use for back referencing in regular expressions:
("There is is coffee in the the kitchen",
This code searches for words that are all letters ([A-Za-z]+) followed by one or more
spaces [ ]+ followed by the first matched subexpression in parentheses. The parser
detects the two occurrences of is as well as the two occurrences of the and replaces
them with an asterisk, resulting in the following text:
There * coffee in * kitchen
Anchoring a regular expression to a string
You can anchor part of a regular expression to either the beginning or end of the string
being searched:
th
parenthesized subexpression.
"([A-Za-z]+)[ ]+\1","*","ALL")
If a caret (^) is at the beginning of a subexpression, the matched string must be
at the beginning of the string being searched.
If a dollar sign ($) is at the end of a subexpression, the matched string must be
at the end of the string being searched.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion studio 4.5

Table of Contents