For example, enter $3 in
the Replace With box to represent the third grouped pattern in the Find box.
Remember that the dollar sign is also used after a character or pattern to indicate the last
character in a line in a Find expression.
Table 8-6 shows how regular expressions use grouping.
CAUTION CAUTION
272
Designing and Crafting Core Pages Part II
TABLE 8-6
Regular Expressions Grouping
Character Matches Example
(p)
(entered in the Any pattern p (\b\w*)\.(\w*\b) matches two patterns, the first
Find In box) before a period and the second, after, such as in
a filename with an extension. The backslash
before the period escapes it so that it is not
interpreted as a regular expression.
$1, $2 . . . $9
(entered in The nth pattern noted with parentheses If the Search field contains the pattern
the Replace (\b\w*)\.(\w*\b), and the Replace With field
With box) contains the pattern $1??™s extension is ???.$2???,
Chapter09.txt would be replaced with
Chapter09??™s extension is ???.txt???.
Controlling Whitespace
Whitespace refers to any portion of the page that doesn??™t contain text, images, or other objects. It includes
the space between words and the space above and below paragraphs. This section introduces ways to adjust
paragraph margins and the spacing between paragraphs.
Pages:
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572