Seriously off topic: What to do when a document has a mismatch of one and two spaces after the end of a sentence?

The grammar checker can be configured to flag this, but doesn’t provide a change all option, just a change! 

The answer is to use regex in find and replace (Ctrl+H):

Find what: ([.\?\!]{1} )([A-Z]{1})
Replace with: \1 \2
Options: Use wildcards

Just to be sure, here’s a screenshot:


The above will change any sentence end (full stop/period, question mark or exclamation mark) followed by one whitespace and then a capital letter into two whitespaces and the capital letter, e.g.

Did he jump? No, he did not.


Did he jump?  No, he did not.

Because we use an uppercase regex [A-Z] we don’t accidently change text that follows an acronym such as e.g. or etc.

The only problem is fields.  The regex doesn’t match fields.  I use a CUSTOMERNAME field, so many of my sentences start with the name of the customer, e.g. Contoso decided that…

I have thus far had to resort to the grammar checker to fix these, but at some point I will get bored of doing that and will work out how to fix a field too.  Feel free to expedite my understanding via the comments…  Smile


About Paul Williams

IT consultant working for Microsoft specialising in Identity Management and Directory Services.
This entry was posted in Off-topic and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s