User-defined wild cards, Any character from a set ∑ excluding return), Any character not from a set ∑) – Nisus Writer Pro User Manual

Page 342: Characters with a unique match, Repeat characters, Any character from a set ! excluding return) 322, Any character not from a set !), Any character from a set ! excluding return)

Advertising
background image

322

Using PowerFind Pro

Finding and Replacing Text

User-defined wild cards

PowerFind Pro also allows the user to define wild cards.
There are two ways to define wild cards. One way is to list all the characters that the wild card
matches between brackets []. For example, the expression [abc] is a wild card that matches any of
the three letters a, b, or c and nothing else.
Another way is to list all the characters the wild card does not match between brackets and a caret
[^]. Here the caret means “not in the set.” For example, [^abc] is a wild card that finds any
character that is not a, b, c, or Return. To include the Return character in the set, use the
expression [[^abc]||[\n]].

[!]

(any character from a set ! excluding Return)

[∑] can define a range, an enumerated set, or a combination of both. To define a range use a
hyphen “-” between the start of the range and the end of the range. For example, the wild card [a-f]
represents any character in the alphabetic range from a through f. If you use the bracket to define a
set that includes any digit, you cannot use \d, but must type 0-9 between the brackets. The range
assumes the order of increasing ASCII (Unicode) codes. Enter the hexadecimal representation for
space \x20.
Be sure to uniquely define each specified character, which means you cannot use certain wild
cards. A backslash \ preceding any other character causes Nisus Writer Pro to interpret the
character literally. For example, to use the six characters , ], [, -, ^ and \ in a set begin the string
with \. Enter \ twice to include the \ character itself.
Nisus Writer Pro interprets all characters inside the brackets [] literally. For example, a search for
[:a] matches a colon or an a.

[^!] (any character not from a set !)

[^∑] finds any character not in the set . For example, [^a-z] finds any character not a lowercase
alphabetic and the pattern [^!-~] finds any character whose ASCII (Unicode) code is not in the
range 33 to 126. A particularly useful application of this metacharacter is for finding columns of
text; the expression [^\t]+\t finds anything that is not a tab (which appears one or more times)
followed by a tab.

Characters with a unique match

These metacharacters usually match a character that does not print. Because these characters are
a unique match, you can use them in Find and Replace expressions.

Character

Finds

\0 (null)

Null character (ASCII (Unicode) code 0)

\b

Backspace character (ASCII (Unicode) code 8)

\t

Tab character (ASCII (Unicode) code 9); press

1

@

to insert an actual tab

character in an expression

\n

Newline (OS X end of line character)

\v

Vertical Tab

\f

Page breaks or a form feed character (ASCII (Unicode) code 12); use \f as a replace
expression to remove all page breaks created by choosing the menu command
Insert > Page Break as well as all the various section breaks inserted using the
menu command Insert > Section Break

\r

Return character (ASCII (Unicode) code 13) press

4

<

to insert an actual

Return character in an expression

\s

Any White Space character

Repeat characters

The plus, asterisk, and minus sign + * - signal the repeat of the previous character or
parenthesized expression. Repeat characters follow a character or parenthesized expression.
When searching backward, Nisus Writer Pro finds the shortest sequence.

Character

What it Does

+

Finds one or more occurrences of whatever that character or expression matches;
the equivalent of the command 1+ on the Repeat menu

Advertising