Using Wildcard Characters

Select the Pattern match check box in the Replace dialog (Edit | Find and Replace | Replace) box to use wildcard characters to perform pattern matching.

This option also allows you to find text matching a variety of different search criteria. Consider the following table:

Text To Find

Wildcard to Use

Some Examples

Any one character

.

D.M matches "DIM" or "D4M".

Character set

[ ]

D[MI]S finds "DIS" and "DMS" but not "DMIS" or "DUS".

Any one character in a range

[-]

LINE[2-6] finds "LINE2" and "LINE3" but not "LINE1" or "LINE7". Ranges must be in ascending order.

Any one character except character(s) inside brackets

[^]

POINT[^32] finds "POINT1", "POINT5", and "POINT12", but not "POINT3", "POINT2", "POINT21", or "POINT30".

Any one character except range of characters inside brackets

[^x-z]

LINE[^2-5] finds "LINE6" and "LINEH", but not "LINE3"

Character sets that include the "-" character should have the "-" as the first or last character of the range. If the range excludes the "-" then the "-" should be the second character.

[-]

LINE[0-9-] matches "LINE4" and "LINE-". LINE[^-0-9] matches "LINEH" but not "LINE-".

0 or more instances of the preceding character, unless the following:

"*" starts a string

"*" follows a "^" that starts a string

"*" starts a parenthesized sub-expression

*

lo*p matches "lp" and "looooop".

^* matches a "*" if it starts a line.

Line beginning with a specified phrase or character. The "^" is special only at the beginning of a string.

^

^CIRCLE finds all lines that begin with the word "CIRCLE". Note that indented lines in the software's Edit window begin with spaces.

Line ending with a specified phrase or character. The "$" is special only at the end of a string.

$

ENDMEAS/$ finds lines ending in "ENDMEAS/" but not "MEAS/"

Parentheses in the Find What box store what is within them to be recalled later in the Replace With box.

In the Replace With box a backslash "\" character, followed by a number would bring that defined pattern into the replace text.

() and \

Find What: BO(BB)Y(RAY)

Replace With: DO1YP2

Would Give: DOBBYPRAY

\1 uses the first set of characters offset by parentheses, \2 the second set and so on.

For pattern matches, you no longer need to precede parentheses with a backslash (\) character as you had to do in some earlier versions of PC-DMIS.