Searching for Text that Doesn't End a Paragraph

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

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 it 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, 2013, 2016, 2019, and Word in Microsoft 365.

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


Trimming Spaces from Strings

When processing text with a macro, you often need to remove extraneous spaces from the text. VBA provides three handy ...

Discover More

Returning the Left-most Characters

When working with text in a formula, you may need to extract the left-most characters from a string of text or from a ...

Discover More

Excel 2010 Serious Sorting (Table of Contents)

Sorting data means that you organize it in whatever order you desire. Excel's sorting feature can be used in a variety of ...

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)

Protecting Document Areas from Global Replacements

You may have boilerplate text that you need to include in your document, and it would be detrimental to accidently change ...

Discover More

Changing the Position of the Dollar Sign

When you receive documents created by others, it is not unusual that you'll want to edit what they've written. For ...

Discover More

Initiating a New Search

I do a lot of searching in my documents. Sometimes the searches may not go exactly as I expected. Here are some things I ...

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}] (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 three more than 1?

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.


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.