Find a seven-digit phone number, Find repeated groups of characters, Using powerfind pro – Nisus Writer Pro User Manual

Page 338: Tabs at the end of paragraphs, Ge 318. a

Advertising
background image

318

Using PowerFind Pro

Finding and Replacing Text

Using PowerFind Pro

Everything you’ve learned about finding and replacing text with Normal Find and PowerFind also
applies to PowerFind Pro.
PowerFind Pro uses metacharacters

11

to represent the wild cards and other specialized feature

characters which are used in the Find/Replace window. While PowerFind used bubbles to represent
the special feature characters, PowerFind Pro uses text which you type from the keyboard (or
choose from the menus) in one, two, and three character combinations to represent these same
special characters and more. PowerFind Pro metacharacters enable even more elaborate Find/
Replace options. When PowerFind Pro is the active method you can still choose any of the
commands from the Find/Replace window’s menus, however, Nisus Writer Pro displays them as
actual textual metacharacters, not as the bubble expressions.
The metacharacters Nisus Writer Pro uses for Find and Replace expressions in PowerFind Pro are
based on GREP (often called a “Global Regular Expression Parser”), a feature of UNIX® operating
systems. Even if you do not have a programming background or a familiarity with UNIX, with a little
practice, you’ll be surprised how easily you can learn to manipulate text with PowerFind Pro and
extend your use of Nisus Writer Pro from an elaborate electronic typewriter to a full featured writing
environment.
You can study the examples already discussed in the section “Examples of putting PowerFind to
use
” beginning on page 313, but here as well, simply choose PowerFind Pro (regex) instead of the
menu command Search Type > PowerFind.
The following examples illustrate some of PowerFind Pro’s capabilities and provide useful
procedures that you can adapt. The instructions assume the Find/Replace window is open and that
you chose the menu command Search Type > PowerFind Pro (regex).

Exercises, or examples of putting PowerFind Pro to use

Find a seven-digit phone number

This expression finds a seven-digit phone number that includes a hyphen.

Enter \d\d\d-\d\d\d\d in the Find box.

\d

is the metacharacter that represents any numeric (0 through 9) character

-

represents the - (hyphen) character.

Find any number of trailing spaces in a document or tabs at the end of paragraphs

Use this expression to clean up electronic files that contain extra characters.

Enter [[:blank:]]+$ in the Find box.

[[:blank:]]+$ is a metacharacter statement made up of the PowerFind Pro metacharacters
which signify

[[:blank:]]

space or tab character

+

is equivalent to

(1+ on the Repeat menu).

$

located at the end of a paragraph character.

Find the invisible null (ASCII (Unicode) 0) character

Enter \0 in the Find box.

\0

is the metacharacter that represents the invisible null character (ASCII (Unicode)
code 0).

Find repeated groups of characters

Here’s how to find 121212, as well as 1212 and 12, as in the phrase, “Send 12 of part number
121212 to room 1212 at building 412 in Troy, NY 12180.” With Whole Word turned on, Nisus Writer
Pro would find the first three numbers, 12, 121212, and 1212. With Whole Word turned off, Nisus
Writer Pro would find the 12 in 412 and 12180 as well.

Enter (12)+ in the Find box.

( and )

are equivalent to the parentheses commands in the Match menu.

11

The term “metacharacter” refers to the character standing for something beyond the “normal” “literal” or “usual”

meaning of the character (similar to the use of the word “metaphysics”).

Advertising