Replace two or more spaces with one space, Find ten-digit phone numbers, And 325 – Nisus Writer Pro User Manual

Page 345

Advertising
background image

Polishing & Managing Documents

325

Replace two or more spaces with one space

People who learned to type using typewriters learned to type two spaces at the end of each
sentence. This was important because the typewriter’s characters were in a monospaced font (each
character had the same width). Typing two spaces at the end of each sentence helped the reader to
scan the text. On the computer, most fonts are “fractional” and the old requirement for two spaces
after a period no longer applies.

12

The following expression replaces two or more spaces with one space.

1. In the Find what text box enter: ([\x020][\x020]+)
2. In the Replace with text box enter: \x20

While you may not see them, you may have typed many spaces at the end of paragraphs. Though
this does not affect the meaning of your text, it may affect the formatting. The following expression
removes “trailing spaces” (those spaces that hang at the end of a line before a Return character
[ASCII (Unicode) 13]).

1. In the Find what text box enter: ([\x20])(\n)
2. In the Replace with text box enter: \2

Find ten-digit phone numbers

You may have received files that have many phone numbers in them in multiple formats and you
need to find them to make them all match. Alternatively, you may have a file with a phone number
in it, but you don’t remember what the number is and you need to find it. To find phone numbers,
with or without area codes, use this Find expression:

In the Find what text box enter:
(1[\x20\t]*-?[\x20\t]*)?(\(?\d\d\d\)?)?[\x20\t]*-?[\x20\t]*\d\d\d[\x20\t]*-?[\x20\t]*\d
\d\d\d

The above expression finds phone numbers in any of these forms (notice the presence or absence of
spaces and hyphens)

1-(858) 481 - 1477

1-(858) 481 1477

1-858-481-1477

18584811477

(858)-481 - 1477

(858) 481-1477

858-481-1477

858 481-1477

8584811477

481-1477

481 1477

4811477

12

Williams, Robin. The Mac is not a typewriter. Peachpit Press, Berkeley, CA. 1990.

Advertising