How to to Search for Double-word Typos

How to to Search for Double-word Typos

This regex of the day is great for catching double word typos.

First we're going to set up a group of characters then the forward slash, one matches whatever was most recently matched by this group.

(.+)\1

Let's turn on regex.

Now you can see where we accidentally typed "the" twice.

It highlights other doubles like the two C's in "accurately." It even picks up this two word pattern "and less and less."

Now we can go through the highlights and remove any errors.

Notice that since our group is not defining carriage returns, it won't highlight double returns.