Make sure your spaces follow the punctuation, Replace two or more spaces with one space, Find ten-digit phone numbers – Nisus Writer Express User Manual

Page 220: Displaying & printing documents

Advertising
background image

200

Proofing Documents

Make sure your spaces follow the punctuation

Fast typists frequently press the Space Bar before typing their punctuation. The next expression
finds one or more spaces that precede any punctuation and places them after the punctuation.

Find

(\s)([[:punct:]])

Replace

\2\1

Make sure your punctuation appears inside quotation marks

Common American practice is to have commas and periods appear inside of quotation marks. The
following expression finds these punctuation marks that appear outside quotes and places them
inside the quotes.

Find

(”)(\.|,)

Replace

\2\1

If you want all punctuation to appear inside quotation marks use this expression

Find

(”)[[:punct:]]

Replace

\2\1

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.

10

The following expression replaces two or more spaces with one

space.

Find

([\x020][\x020]+)

Replace

\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]).

Find

([\x20])(\n)

Replace

\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
(1[\x20\t]*-?[\x20\t]*)?(\(?\d\d\d\)?)?[\x20\t]*-?[\x20\t]*\d\d\d[\x20\t]*-?[\x20\t]*\d\d\d
\d
This 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

(858)-481 - 1477

(858) 481-1477

858-481-1477

858 481-1477

481-1477

481 1477

4811477

10

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

Advertising