Small SEO Tools

How to Find Doubled Words in a Draft

After editing a sentence, you might leave two copies of a short word side by side. A quick proofreading pass can put brackets around those spots in a preview so you can decide which words to remove from the draft.

Mark adjacent repeats in a sample draft

Open Find and Replace Text and paste this sample into Your text.

The the doors open at noon.
We need need need a spare key.
By noon, we had had enough of the cold.

Paste the pattern below into Find with the single backslashes as shown.

\b([A-Za-z]+)(?:[ \t]+\1)+\b

Enter this in Replace with.

[$&]

Turn on Use regular expression and Replace all. Leave Match case and Whole word only off. The pattern already includes boundary checks, and ignoring case lets it catch The the at the beginning of a sentence.

Read the brackets as review marks

Click Replace. The tool leaves your input in place and shows three replacements in the result below.

[The the] doors open at noon.
We [need need need] a spare key.
By noon, we [had had] enough of the cold.

Each bracketed run counts once, so the three copies of need account for one replacement. The replacement token $& inserts the whole match between the brackets, keeping its capitalization and spacing. See the ECMAScript substitution rules.

Correct the first two lines in your saved draft to read “The doors open at noon.” and “We need a spare key.” Keep had had in the third line. The first had helps form the past perfect, and the second is the main verb. The count tells you how many places to review.

See what the pattern can catch

([A-Za-z]+) captures the first run of English letters. \1 asks for the text captured by that first group again. With Match case off, a different capitalization can still match. The + after (?:[ \t]+\1) includes all consecutive repeats in one match. See the MDN guide to backreferences.

[ \t]+ allows one or more ordinary spaces or tabs between copies. A comma in go, go, a line break between two copies of ready, and the longer second word in go good all leave those examples unmarked.

The \b checks use JavaScript word boundaries. In re-check check the door, the hyphen lets the pattern mark check check even though the first check belongs to a compound. Apostrophes and letters outside A–Z can produce similar partial matches. Use the pattern on plain English prose and read the full sentence around each result. See the MDN guide to word boundaries.

Check the actual edits

Paste a fresh copy of your revised draft into the tool and run the same check. In this sample, the revised text has one remaining match, had had. Use the draft comparison guide to confirm that you removed the accidental repeats on the first two lines and kept the rest of the draft intact.