A Word Wildcard Cheat Sheet: Strings Worth Keeping
Every editor who uses Word wildcards ends up with a scratch file somewhere. A text document, a note in a project folder, occasionally a Post-it. It contains four or five strings that took ages to work out and now get pasted in whenever the same problem comes round again.
This is that file: a Word wildcard cheat sheet, organized and considerably longer.
The strings below are worth having to hand not only because they save time but because reading other people's strings is the fastest way to get better at writing your own. Take one apart, work out why each piece is there, and the next one you build from scratch will be better.
| Symbol | What it does |
|---|---|
? |
Exactly one of any character |
* |
Zero or more characters |
< > |
The start or end of a word |
[ ] |
Any one character from a list |
[-] |
A hyphen inside brackets defines a character range |
{n} |
Exactly n occurrences of the previous character or expression |
{n,} / {n,m} |
At least n, or between n and m occurrences |
@ |
One or more occurrences of the previous character or expression |
[!] |
Inside brackets, excludes the listed characters |
( ) |
Groups an expression for recall |
\ |
Escapes a wildcard or recalls a grouped expression |
And the caret codes, the table people actually come back for:
| Character | Symbol |
|---|---|
| Nonbreaking space | ^s |
| Nonbreaking hyphen | ^~ |
| Tab | ^t |
| Line break | ^l |
| Paragraph mark | ^13 (Find) / ^p (Replace) |
| En dash | ^= |
| Em dash | ^+ |
Spacing and punctuation
Turning spaced full stops into a proper ellipsis
Find: .[ ^s].[ ^s].
Replace: ...
Catches both normal and nonbreaking spaces between the stops.
Keeping a copyright line together
Find: ©([0-9]{4})>
Replace: ©^s\1
©2023 becomes © 2023, with a nonbreaking space so the symbol and year never split across a line break.
Spacing temperatures
Find: ([0-9.]@)(°[CF])
Replace: \1^s\2
Same principle. 98.6°F becomes 98.6 °F, held together by a nonbreaking space.
There's a general habit hiding in those last two. When you're already touching a piece of text, ask whether it would look wrong split over two lines: copyright lines, measurements, citations, initials. If so, put a nonbreaking space in while you're there. It costs nothing extra and saves a later round of tidying.
Dates
Reordering a short-form date
Find: ([0-9]{1,2})/([0-9]{1,2})/([0-9]{2,4})
Replace: \2/\1/\3
This swaps the first two date elements, changing month/day/year to day/month/year or vice versa.
Padding single-digit months
Find: <([0-9]{1,2}/)([0-9])(/[0-9]{4})
Replace: \10\2\3
3/9/2020 becomes 3/09/2020. And this is the string that explains why nine expressions is Word's limit: \10 can only mean "expression one, then a zero", because there is no expression ten.
Numbers and currency
Swapping a currency abbreviation for a word
Find: ([£$€][0-9]@)K
Replace: \1^sthousand
£40K becomes £40 thousand, without disturbing every other capital K in the document.
Moving an ISO 4217 code in front of the amount
Find: <([0-9,.]@)([ ^s])([A-Z]{3})>
Replace: \3\2\1
400 EUR becomes EUR 400.
Adding a leading zero to a decimal
Find: ([!0-9])(.[0-9]@)
Replace: \10\2
.75 mg becomes 0.75 mg. Note that the job is mostly about making sure you're not adding a zero where one is already there, which is what [!0-9] handles.
Words and affixes
Closing up a prefix, with exceptions
Find: <([Aa]nti)-([!i][a-z]@)>
Replace: \1\2
anti-social becomes antisocial; anti-inflammatory is left alone.
Fixing a triple letter
Find: ([A-VX-Za-vx-z])\1\1
Replace: \1\1-\1
crosssection becomes cross-section. The inventory deliberately excludes W and w so that WWW and www in URLs survive.
Correcting a predictably misspelled word
Find: ac{1,2}om{1,2}odation
Replace: accommodation
It fixes every combination of the two mistakes at once and harmlessly replaces the correctly spelled version with itself.
Before you use any of them
Three rules that never stop applying.
Save the document first and work on a copy.
Check that Track Changes is off. Wildcard searches can miss text interrupted by deleted tracked changes, and replacements made with tracking on can be harder to review.
Run Find before Replace All every time, and inspect a few hits to confirm the string is doing what you think.
None of these strings is guaranteed safe in your particular document. They're starting points, and every one of them may need narrowing for the text in front of you.
Build your own library
The real value is never having to write the same string twice. Keep them somewhere you'll find them again, with a note of what each one does and, more usefully, what it deliberately doesn't catch.
Better still, put them into a PerfectIt style sheet as Wildcard Find & Replace checks. Then the checks run automatically on every document, showing you each hit in context before anything changes.
Get the full guide, free
Brave New Word is our free ebook on Wildcard Find & Replace in Word and PerfectIt, by our in-house linguist Chris Ryder. Its final chapter is a full index of ready-made strings, including abbreviations, capitalization, currency, computing, dates, times, mathematics, punctuation, and grammar. This index has been built from years of developing bespoke styles for PerfectIt customers. In the ebook, you’ll also find the complete symbol set, dozens of worked examples by discipline, chapters on limitations and troubleshooting, and two on PerfectIt. And yes, a printable cheat sheet as a little bonus.