Searching for Text that Doesn't End a Paragraph

by Allen Wyatt
(last updated March 19, 2018)

Richard needs to search through a document and look for a period followed by a quote mark (."), but only if those two characters do not occur at the end of a paragraph. He figures this search can be done using wildcards, but he's not quite sure of the pattern to use in the search.

There are a couple of ways you can tackle this need. The first is to follow the brute-force method of using Find and Replace. Using multiple passes through the document, simply rename the item you don't want to change, change what's left, then rename the original back to whatever it was to start with. In the first of these three passes you would search for a period, quote mark, and paragraph mark, replacing it with something that doesn't occur in the document (such as the phrase 'parmark'). Then search for the period and quote mark combination and replace it with whatever you want. Finally, search for the phrase you used ('parmark') and replace it with a period, quote mark, and paragraph mark.

There is a huge drawback to this approach, though, and it is introduced because you are replacing paragraph marks. Remember that a paragraph mark contains the paragraph-related formatting for the paragraph that it ends. If you do away with a paragraph mark in the Find-and-Replace operation, then the paragraph becomes part of the following paragraph and loses any distinctiveness it had. Thus, if the ." combo ended a bulleted or numbered list paragraph, the Find and Replace "unformats" that paragraph and causes it to adopt the formatting of whatever paragraph follows it.

The solution is to, instead, use the second method, which involves doing a wildcard search. When you display the Replace tab of the Find and Replace dialog box, make sure the Use Wildcards check box is selected. (To see the check box, you'll need to click the More button if is is available.) In the Find What box, use this pattern:


This pattern means you are searching for a period followed by a single character designated by whatever is in the first set of brackets. There are two characters there: a regular quote mark and a closing smart quote. (Wildcard searches make a distinction between normal quotes and smart quotes.) The closing smart quote is most easily entered by using copy and paste—copy it from someplace in your document and paste it into the pattern.

The second set of brackets in the pattern specify to find any character except the one noted. The character noted is a paragraph mark (^13), but adding the exclamation mark in front of it means don't match any paragraph marks.

There is an important caveat to mention here, and it has to do with the nature of the document you are searching. It is not uncommon to have "trailing spaces" at the end of paragraphs. Normally you wouldn't notice a stray space or two, as they don't really show up on the screen and they don't affect what may be printed. However, they will affect this particular wildcard search. The ." combo followed by a space or two and then a paragraph mark is much different than ." followed immediately by a paragraph mark. The wildcard search will match the former and ignore the latter, when you probably want it to match both.

The only way around this potential gottcha is to make sure that you get rid of any trailing spaces before your do the search for the ." combo. It is easiest to see if you have such trailing spaces in your document by turning on non-printing characters so they are visible. You can also do a regular Find and Replace, looking for a space followed by a paragraph mark and replacing it with a paragraph mark.

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

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. ...


Removing Duplicates Based on a Partial Match

Some types of data may have certain fields that contain partially identical information. In such cases you may want to ...

Discover More

Ensuring Proper Page Numbers for a Table of Authorities

Automatically create a Table of Authorities entry in your document, and Word might place the necessary field at the wrong ...

Discover More

Squeezing Lines Together

The space between lines of text is technically referred to as "leading." This tip examines various ways you can adjust ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Replacing Hidden Text

Word allows you to format text so it can be easily hidden from view and from printing. If you want to convert the hidden ...

Discover More

Making Ctrl+F Work Traditionally

One change introduced in Word 2010 was the new navigation pane that is used for simple searching of information. This ...

Discover More

Quick and Dirty Paragraph Count

Need to know how many paragraphs are in a document? You can use Word's Find and Replace feature to get a count quickly.

Discover More

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

View most recent newsletter.


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}] 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 eight minus 8?

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.

Newest Tips

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.