Applying Styles and Removing Characters using Find and Replace

Written by Allen Wyatt (last updated January 20, 2024)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021


In reformatting a document, Leah needs to apply the same paragraph style to all paragraphs beginning with (a), (b), (c), and (d). She can use Find and Replace to apply the style, but then she needs to do a second Find and Replace pass to get rid of the (a), (b), (c), and (d) characters. Leah wonders if there is a way to both apply the style and remove those characters in a single pass.

Actually, this can be accomplished with the use of wildcard characters in Find and Replace. Rather than go through all the steps, just remember that you want to do an advanced search (so that the Find and Replace dialog box is displayed), click the More button (if it is available) and then make sure the Use Wildcard check box is selected. Here is what you want to place in the Find What box:

\([a-d)]\)[ ]{1,}(*^13)

This may look, at first glance, like gibberish—particularly if you are not used to using wildcards—but it is fairly straightforward. The backslashes at the beginning tell Word that the immediately following character should be used as a literal character. That means that the following sequence will search for (a), (b), (c), or (d), any of which would be considered a match:

\([a-d)]\)

If you might have other letters in parentheses, you could change the a-d part to something like a-z, so that any lowercase alphabetic character between parentheses would be matched.

The second part indicates that the next characters should be any number of spaces:

[ ]{1,}

This assumes, of course, that the (a), (b), (c), or (d) is followed by at least one (or more) spaces. If some other character might immediately follow the parenthetical—such as a tab or no spaces at all—then this portion of the search pattern will need to be changed to reflect what is in your document.

The final part of the search pattern is this:

(*^13)

This tells Word to find any number of characters (*) up through and including a hard return. In other words, the entire paragraph is selected. The parentheses around this portion of the pattern are important, as they allow whatever matches this portion of the found text to be referenced in the Replace With field of the Find and Replace dialog box. In fact, this is all that should go into the Replace With field:

\1

This tells Word that you want to replace whatever is found with what is in the first set of parentheses in the Find What pattern, which happens to be the entire paragraph minus the (a), (b), (c), or (d) and any trailing spaces. The only other thing you need to do is make sure that for the Replace With field you pick the style you need applied to replacement. (See Figure 1.)

Figure 1. Setting up the Find and Replace dialog box.

Once the Find and Replace dialog box is set up with the proper patterns (as described above), just click on Replace All and you are done.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (4274) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, Word in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Printing AutoText Entries

If you want to print a list of the AutoText entries on your system, you can do so quickly by making one change on the ...

Discover More

Formulas Don't Calculate as Formulas

Enter a formula (starting with an equal sign) and you may be surprised if Excel doesn’t calculate the formula. Here's a ...

Discover More

Excel Self-Tests

Need to find out how good you are with Excel? Here are some places you can check out to quiz yourself.

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Changing European Dates to US Dates

Want to change the order of the day and month in a date? This tip shows you how you can do so using the Find and Replace ...

Discover More

Controlling Case in Find and Replace

When using Find and Replace, how Word handles the case of letters in replacements can be confusing. It needn't be, if you ...

Discover More

Getting Rid of Hidden Text in Many Files

Hidden text is a great boon if you want to make sure something doesn't show up on the screen or on a printout. If you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 + 5?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.