519 Appendix B. Find/Replace Expressions
This appendix lists all the available PowerFind and PowerFind Pro metacharacters, as well as the search options available when using Find/Replace expressions in a macro. For instructions on using Find/Replace, see Chapter 11; for macro syntax and conventions, refer to Chapter 12.
Wild Card metacharacters allow you to use a single expression to represent an entire set of characters; any character in the set will constitute a match to the metacharacter. Table B.1 lists the PowerFind (where applicable) and PowerFind Pro representations of each metacharacter. The Same As column gives an equivalent PowerFind Pro expression for some metacharacters. The right-hand columns indicate whether the metacharacter matches European (or diacritical) characters (Eu), the underscore character, ASCII 95 (und), and the return character, ASCII 13 (¶), plus how many of the 256 characters in a font are matched (# matches).
|
520 Description |
PowerFind |
|
Same As |
Eu |
und |
¶ |
|
|
Any Character |
|
|
Y |
Y |
N |
255 |
|
|
Any Character or ¶ |
![]() |
|
Y |
Y |
Y |
256 |
|
|
Any Word |
|
|
|
Y |
Y |
N |
|
|
Any Text |
|
|
Y |
Y |
Y |
|
|
|
A-Z a-z |
|
|
|
Y |
N |
N |
114 |
|
_, A-Z a-z |
|
|
|
Y |
Y |
N |
115 |
|
_, non-(A-Z a-z) |
|
|
N |
Y |
Y |
142 |
|
|
non-(A-Z a-z) |
|
|
N |
N |
Y |
141 |
|
|
A-Z a-z 0-9 |
|
|
|
Y |
N |
N |
124 |
|
_, A-Z a-z 0-9 |
|
|
|
Y |
Y |
N |
125 |
|
|
|
|
N |
Y |
Y |
132 |
|
|
0-9 |
|
|
|
N |
N |
N |
10 |
|
a-z |
|
|
Y |
N |
N |
59 |
|
|
A-Z |
|
|
Y |
N |
N |
55 |
|
|
European1 |
|
|
Y |
N |
N |
62 |
|
|
non-European1 |
|
|
N |
N |
Y |
194 |
|
|
Any Octal Digit |
|
|
|
N |
N |
N |
8 |
|
Any Hex Character |
|
|
|
N |
N |
N |
22 |
|
Any Character in a word2 |
|
|
Y |
Y |
N |
|
|
|
521 Any Gremlin3 |
|
|
N |
N |
N |
159 |
|
|
Any Gremlin, tab, or space |
|
|
|
N |
N |
N |
161 |
|
Any Control Character4 |
|
|
N |
N |
N |
31 |
|
|
Anything in set6 |
|
|
|
|
N |
|
|
|
Anything not in set6 |
|
|
|
|
N |
|
|
|
Anything in set plus return6 |
|
|
|
|
Y |
|
|
|
Anything not in set plus return6 |
|
|
|
|
Y |
|
|
|
Notes: 2This metacharacter will match any character that is currently part of a word as Nisus Writer defines it (see Chapter 11, Whats In a Word?). 3A gremlin is defined as any character with an ASCII value of 08, 1012, 1431, or 127255. These include control characters and upper-ASCII characters, and are most frequently seen in files imported from another system. 4A control character is defined as any character with an ASCII value of 012 or 1431. Control characters are not printable in most Macintosh fonts. 5The metacharacter for any control character is a colon followed by a space ( 6List the characters you want to find within the brackets. Everything between the brackets is interpreted literally, so you cannot use other wild cards within a set. |
|||||||
Table B.1. Wild Card metacharacters.
Special characters (Table B.2) include those listed on the Find/Replace dialog boxs Special menu and a few other PowerFind Pro-specific metacharacters in the same vein. Each of these (except OR) matches just one or two specific ASCII values as shown in the ASCII column.
|
Description |
ASCII |
PowerFind |
PowerFind Pro |
|
OR |
|
|
| |
|
¶ |
13 |
|
\r |
|
Space |
32 |
|
\s |
|
Tab |
9 |
|
\t |
|
|
|
|
:b |
|
Page Break |
12 |
|
\f |
|
Null |
0 |
|
\0 |
|
Backspace |
8 |
|
\b |
|
Linefeed |
11 |
|
\v |
Table B.2. Special metacharacters.
Repeat # metacharacters allow you to specify in your search pattern how many times a particular character, set, or wild card may occur consecutively and still match the pattern. Table B.3 lists the metacharacters found on the Repeat # menu plus the PowerFind Pro metacharacters for the shortest match of each expression (see Chapter 11).
523
|
Description |
PowerFind |
PowerFind Pro |
|
0+ |
|
|
|
1+ |
|
|
|
0 or 1 |
|
|
|
0+, shortest match |
|
|
|
1+, shortest match |
|
|
|
0 or 1, shortest match |
|
|
Table B.3. Repeat # metacharacters.
Position metacharacters specify where a character, set, or metacharacter is to appear in relation to other characters. They can also be used in a Find expression to move the insertion point without selecting any text. Table B.4 lists the Position metacharacters (all of which appear on the Position menu in the Find/Replace dialog box).
|
Description |
PowerFind |
PowerFind Pro |
|
Character on Left: |
|
|
|
|
|
|
|
Word Start |
|
|
|
Line Start |
|
|
|
¶ Start |
|
|
|
Document Start |
|
|
| Word End |
|
|
|
¶ End |
|
|
|
Document End |
|
|
Table B.4. Position metacharacters.
The Match metacharacters allow you to group parts of your Find expression together and to refer to any or all of the found text later in the Find/Replace expression. They also allow you to use the contents of any clipboard in a Find/Replace expression. Table B.5 lists the metacharacters from the Match menu and a few additional characters available in PowerFind Pro.
|
Description |
PowerFind |
PowerFind Pro |
|
Current Clipboard |
|
|
|
Clipboard #0 to #9 |
|
|
|
Found (or selected) item |
|
|
|
( |
|
|
|
) |
|
|
|
(, no replacement1 |
|
|
|
), no replacement1 |
|
|
|
Found 1 through Found 9 |
|
|
|
Found 10 through Found 63 |
|
|
|
Note: |
||
Table B.5. Match metacharacters.
The search options in Table B.6 can be used as arguments of Find/Replace (and related commands) in a macro. See Chapter 12 for more detailed instructions. Appendix D lists the variants of Find/Replace along with the proper syntax for using them in macros.
525
|
Option |
Meaning |
Equivalent Control or Menu Command |
|
|
Replace All |
|
|
|
Wrap Around |
|
|
|
Dont Wrap Around |
|
|
|
Copy Find (and/or Replace) expression (and all search options) to Find/Replace dialog box without performing a search |
|
|
|
PowerFind expression |
|
|
|
Jump to end of document if nothing found |
|
|
|
PowerFind Pro expression |
|
|
|
Find Literal (This option is needed only if PowerFind Pro is selected as your default Find method in the Finding Preferences dialog box.) |
|
|
|
Search all open documents |
|
|
|
Search front document only (same as |
|
|
|
Ignore Case |
|
|
|
Index (instead of Replace) |
|
|
|
Replace All in the current paragraph only |
|
|
|
Use Search List |
|
|
|
Search active document only (same as |
|
|
|
Select last text changed after a Replace All within the current selection (requires either |
|
|
|
Find text only |
|
|
|
Find is attribute-sensitive |
|
|
|
Replace text only |
|
|
|
Replace is attribute-sensitive |
|
|
|
Reverse (search toward beginning of document) |
Up arrow in Find/Replace dialog |
|
|
Replace All in current selection |
|
|
|
Find is script-sensitive |
|
|
|
Find is not script-sensitive |
|
|
|
Terse (no dialog box displayed if nothing found) |
|
|
|
Terminate macro if nothing found |
|
|
|
Verbose (display number of items found/replaced) |
|
|
527 |
Whole Word |
|
|
|
Not whole word |
|
|
|
Wrap Around (same as |
|
|
|
Dont Wrap Around (same as |
|
|
|
Use with Find Next to place the pathnames of files on the search list onto the clipboard |
|
|
|
Ignore Diacriticals |
|
|
|
Root of Word |
|
|
|
Find aleph with all nikkudot (Hebrew only) |
1 |
|
|
Find yaa with all diacriticals (Arabic only) |
1 |
|
|
Sounds Like find |
|
|
|
Use options currently selected in Find/Replace dialog box (must be first option listed if used). |
|
|
Note: |
||
Table B.6. Search options.
Copyright © 1995, 1996, 1999 by Joe Kissell