beautypg.com

Adobe InDesign CS3 User Manual

Page 146

background image

INDESIGN CS3

User Guide

139

Non-marking
parentheses

(?:expression)

(quick) ($:brown) (fox)

The quick brown fox jumps up and
down.

The quick brown fox jumps up
and down.

All found text = quick brown fox;
Found Text 1= quick; Found Text 2
= fox

Case-insensitive
on

(?i)

(?i)apple

You can also use (?i:apple)

Apple apple APPLE

AppleappleAPPLE

Case-insensitive
off

(?-i)

(?-i)apple

Apple apple APPLE

Apple apple APPLE

Multiline on

(?m)

(?m)^\w+

In this example, the expression looks for
one or more (+) word characters (\w) at the
beginning of a line (^). The (?m) expression
allows all lines within the found text to be
treated as separate lines.

One Two Three Four Five Six Seven
Eight

One Two ThreeFour Five SixSeven
Eight

Multiline off

(?-m)

(?-m)^\w+

One Two Three Four Five Six Seven
Eight

One Two Three Four Five Six Seven
Eight

Single-line on

(?s)

(?s)c.a

The searches for any character ( . ) between
the letters c and a. The (?s) expression
matches any character, even if it falls on the
next line.

abc abc abc abc

abc abcabc abc

Single-line off

(?-s)c.a

abc abc abc abc

abc abc abc abc

Ignore
whitespace on

(?x)

(?s)\w \w\w

This searches for any word character (\w)
followed by a space, followed by two more
word characters (\w\w). The (?s) expression
essentially ignores all whitespace so that it
looks for three characters in a row (\w\w\w).

The quick brown fox

Thequick brown fox

Ignore
whitespace off

(?-x)

(?-s)\w \w\w

The quick brown fox

The quick brown fox

Repeat number
of times

{ }

b{3} matches exactly 3 times

b(3,} matches at least 3 times

b{3,}? matches at least 3 times (shortest
match)

b{2,3} matches at least 2 times and not
more than 3

b{2,3}? matches at least 2 times and not
more than 3 (shortest match)

abbc abbbc abbbbc abbbbbc

abbc abbbc abbbbc abbbbbc

abbc abbbc abbbbc abbbbbc

abbc abbbc abbbbc abbbbbc

abbc abbbc abbbbc abbbbbc

abbc abbbc abbbbc abbbbbc

Expression

Search string

Sample text

Matches (in bold)