Wildcards in the Real World

I hope you've enjoyed the wildcard "tutorial" articles in Editorium Update over the past few weeks. If you haven't read them, I'd recommend that you do so in order to understand this week's article. You can review the whole series here, starting with the March 20, 2001, issue:

http://www.editorium.com/euindex.htm/

This week I thought you might be interested in seeing some of the wildcard combinations I've used recently in an actual editing project. Maybe you'll find them useful too.

EXAMPLE 1

The manuscript I've been working on has lots of parenthetical references like this:

(Thoreau, Walden, p 10.)

You'll notice that there's no period after the p. To fix these references, I used the following string in Microsoft Word's "Find What" box in the Replace dialog (Edit > Replace), with "Use Wild Cards" (or "Use Pattern Matching") turned on:

p ([0-9]@.))

That's an odd-looking thing with its double parentheses, but its meaning becomes clear when you consider that the first closing parenthesis represents the closing parenthesis of the reference. The backslash in front of it tells Word to treat it as a character rather than the end of a group "expression." So the whole string says this:

1. Find a p followed by a space.

2. Find, as a group, one or more digits followed by a period followed by a closing parenthesis.

I put this in the "Replace With" box:

p. 1

And that string says this:

1. Replace the p followed by a space with p followed by a period and a space.

2. Replace the rest of the "Find What" string (the group in parentheses) with itself.

When I was finished finding and replacing, the references looked like this:

(Thoreau, Walden, p. 10.)

EXAMPLE 2

Here's another example from the manuscript I've been working on:

(Genesis 8:26)

You'll notice that there's no period before the closing parenthesis. Wanting to fix these, I put this string in the "Find What" box:

([0-9]@:[0-9]@))

It says:

1. Find, as a group, any number of digits followed by a colon followed by any number of digits.

2. Find a closing parenthesis character.

I put this in the "Replace With" box:

1.)

And that string says:

1. Replace the group with itself.

2. Replace the closing parenthesis with a period and a closing parenthesis.

When I was finished finding and replacing, the references looked like this:

(Genesis 8:26.)

"Why," you may be wondering, "did you have to use wildcards? Why didn't you just find a closing parenthesis and replace it with a closing parenthesis and a period, like this:

Find What:

)

Replace With:

.)

I couldn't do that because the manuscript had other parenthetical items (like this one) that didn't need a period. Using wildcards makes it possible to find exactly the items you want and ignore those you don't.

EXAMPLE 3

The manuscript had Bible references that looked like this:

II Corinthians

II John

II Kings

I wanted them to look like this:

2 Corinthians

2 John

2 Kings

I put this in the "Find What" box:

II ([A-Z])

The string says:

1. Find I followed by I followed by a space.

2. Find any capital letter.

And I put this in the "Replace With" box:

2 1

That string says:

1. Replace the II with a 2.

2. Replace the capital letter with itself.

Worked like a charm.

"Why," you ask, "didn't you just replace II with 2 throughout the manuscript rather than use wildcards?" Well, I could have. But I was also thinking about other entries like these:

I Corinthians

I John

I Kings

Obviously, I couldn't just replace I with 1 throughout the manuscript, so I used this string in the "Find What" box:

I ([A-Z])

And I used this string in the "Replace With" box:

1 1

And that took care of the problem.

I hope you're beginning to see how powerful wildcards can be and how much time they can save while you're editing a manuscript. Using wildcards, you can quickly fix repetitive problems that would take hours to correct by hand. I highly encourage you to try them, but I also urge you to back up your documents and experiment on some junk text before using wildcards in the "real world." Also, try finding and replacing items individually before replacing all of them globally. Then you'll know that the wildcards you're using actually do what you need to have done.

This entry was posted in Editing. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

You must be logged in to post a comment.

  • The Fine Print

    Thanks for reading Editorium Update (ISSN 1534-1283), published by:

    The EDITORIUM, LLC
    http://www.editorium.com

    Articles © on date of publication by the Editorium. All rights reserved. Editorium Update and Editorium are trademarks of the Editorium.

    You may forward copies of Editorium Update to others (but not charge for it) and print or store it for your personal use. Any other broadcast, publication, retransmission, copying, or storage, without written permission from the Editorium, is strictly prohibited. If you’re interested in reprinting one of our articles, please send an email message to editor@editorium.com

    Editorium Update is provided for informational purposes only and without a warranty of any kind, either express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, and freedom from infringement. The user (you) assumes the entire risk as to the accuracy and use of this document.

    The Editorium is not affiliated with Microsoft Corporation or any other entity.

    We do not sell, rent, or give our subscriber list to anyone. Period.

    If you’d like to subscribe, please enter your name and email address below. We publish the newsletter once a week, and on rare occasions we may send an important announcement. We never, ever send spam. Thank you for signing up!