Using Wildcards to Replace Hyphens Between Numbers with En Dashes
By Jack Lyon, the Editorium
Are you getting the most you can from Microsoft Word? Wildcard search is one of the most powerful features in Word. You can use it to quickly find errors and make changes throughout a document in a matter of seconds. In this article, learn how to use Word wildcards to replace hyphens between numbers with en dashes.
Using Wildcards to Replace Hyphens Between Numbers with En Dashes
Most authors use a hyphen between numbers to indicate a page range in a citation, like this:
See pages 342-49.
But for publication, an en dash is needed rather than a hyphen:
See pages 342–49.
Using wildcards, that’s an easy fix.
Find what:
([0-9])-([0-9])
Replace with:
\1^=\2
In this example, we’re using two groups, both with a range of all numbers (from zero to nine), separated by a hyphen.
In our citation:
See pages 342-49.
That “Find what” wildcard string will find this (two numbers joined by a hyphen):
2-4
The “Replace with” wildcard string will produce this (the two numbers that were found, joined by an en dash, which is specified by the ^= code):
2–4
And that will give us our desired result:
See pages 342–49.
Continue Your Wildcard Education: Free Download!
Ready to learn even more about Word wildcards?
Download the Wildcard Cookbook by Jack Lyon today!
In the Wildcard Cookbook for Microsoft Word, you’ll learn how to build your own wildcard searches with detailed screenshots and instructions. You will gain the confidence you need to implement these time-saving strategies in your work. And if you love the idea of wildcards but are not ready to write your own, the Wildcard Cookbook includes real-world examples that you can simply copy and paste!