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

Searching Through Many Workbooks

If you have a folder that contains dozens or hundreds of workbooks, you may need to search through those workbooks to ...

Discover More

Can't Empty the Clipboard

The Clipboard is essential to move or copy information from one place in Excel to another. If you get an error when you ...

Discover More

Creating New Windows

A great way to work on different parts of the same document at the same time is to create windows. These function as ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Applying a Character Style to Bracketed Text

Word has a powerful Find and Replace capability. It is even more powerful if you turn on its wildcard capability. Here's ...

Discover More

Using Find and Replace to Change Text Case

Can you really use Find and Replace to change the case of text in your document? Not really, but that shouldn't stop you ...

Discover More

Removing HTTP from URLs

Having problems when it comes to replacing information in URLs? You're not the only one; it can be confusing making mass ...

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 7 + 0?

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.