Avoid a Word Find and Replace gotcha that could prove catastrophic

Here's a Find and Replace gotcha that you might not uncover until it's too late. Awareness is the best way to avoid it, so make a note of it.

Word's Find and Replace feature lets you alter multiple instances of a word or phrase at the same time. However, one thing you might not consider is space characters - and they matter.

Let's look at a quick example. In the document below, I have two short sentences. If you can't read the figures, the sentences follow:

You'll receive a certificate at the end of your class. It is notification of your participation. However, it isn't official without a notarized signature, so please make sure to stop on your way out and have the certificate notarized.

Now, let's change all occurrences of is not to isn't. A quick find and replace should do the trick, right? Let's see what happens when we ignore spaces:

  1. Click the Home tab and then click Replace in the Editing group. In Word 2003, choose Find and Replace from the Edit menu.
  2. In the Find What control, enter is not.
  3. In the Replace With control, enter isn't.
  4. Click Replace All and then OK. The results might not be what you expected.

The replace task found one occurrence of is not and replaced it with isn't, correctly. However, it also found is notification and changed it to isn'tification - that's a mistake.

Being mindful of space characters will eliminate these types of unexpected errors. In this case, following the search string (in the Find What control) with a space character will eliminate the inappropriate find, but be careful because doing so will introduce a new error as as shown below.

You must enter a space character after is not in the Find What control and after isn't in the Replace With control to get the desired results.

When this happens, there's no warning that the feature hasn't understood your intentions. The only way to avoid this behavior is awareness. Running a spell check will find most errors of this type, but you can't depend on that. To the feature, a space character is another valid character. Including them in your search and replace strings is the best way to avoid trouble.

Keep in mind that the space characters that occur before the find and replace strings are just as important.

About Susan Harkins

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

Editor's Picks