Powerfind pro replace expressions, Definitions in nisus writer express, Swap the sequence of words – Nisus Writer Express User Manual

Page 219: Change multiple periods to ellipses

Advertising
background image

Polishing & Managing Documents

199

[G-Z]

Finds any uppercase character except A through F

PowerFind Pro Replace Expressions

If a metacharacter or expression has a unique match then it can be used in constructing
replacement patterns. If a metacharacter is not allowed in a particular context, Nisus Writer
Express will not let you select it from the menu in PowerFind. No such restriction applies when
using PowerFind Pro.

Definitions in Nisus Writer Express

Item

What it Defines

Alphabetic Characters

All characters in the range Aa through Zz plus all the

4

and

1

4

alphabetics

(all modified alphabetics European languages use). Modified alphabetics are also
called Diacriticals, sometimes called “delayed strike” characters;

Alphanumeric Characters

All alphabetics and digits 0 through 9, Control Characters, ASCII (Unicode) code
characters 0-12 and 14-31 (these are “non-printing” characters);

Word

Any combination of alphanumeric characters (from as few as one character to
extremely long strings) surrounded by non-alphanumeric characters.

Advanced exercises, or more examples of putting PowerFind to use

These examples explain useful expressions in PowerFind Pro. You can use them as helpful tools for
preparing documents as well as for developing more complex user-defined expressions.

Swap the sequence of words

Swap any two consecutive words even if they are separated by a Return or a tab, use the Find
expression (\m\w+\M)(\s+)(\m\w+\M) and Replace expression \3\2\1. In this example, “report
status” replaces “status report.” Here’s what the characters mean

Character

What it Means

(\m\w+\M)

Finds a whole word (as defined above)

(\s+)

Finds any sequence of blank characters such as spaces, tabs, or Returns

\3

Represents the third parenthesized expression which is the second of the two
words found

\2

Finds whatever the second parenthesized expression (\s+) matches

\1

Finds the first parenthesized expression which is the first of the two words

Find any and/or all words that begin and end with specified characters

You can find any or all words that begin and end with characters you specify. For example all words
that share the same prefix and suffix (such as “preparation” and “prestidigitation”). The example
\m(a)([^\s]*)(d)\M finds every word that begins with “a” and ends with “d” from “ad” through “and”
to “ampersand.”

Character

What it Means

( and )

Expression delimiters, useful if you later want to manipulate the three segments of
the words

\m

Finds the beginning of a word

a

Not a metacharacter, but here it represents the character or string of characters
that must appear at the beginning of the word

[^\s]*

Finds any string of characters that is not a space (the middle of the word which
doesn’t even need to exist)

d

Not a metacharacter, but here it represents the character or string of characters
that must appear at the end of the word

Change multiple periods to ellipses

The following expression finds sequences of two or more periods that follow an alphabetic or a space
and replaces them with an ellipsis “…”. It then removes a space preceding any ellipsis.

1.

Find

([[:alpha:]]\s)(\.\.+)

Replace

\1…

2.

Find

(\s)(…)

Replace

\2

Advertising