Using Word Wildcards to Fix Citations
11 September, 2020
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 help fix a tricky citation issue.
Using Word Wildcards to Fix Citations
A client wrote to me, “How do you write a wildcard to fix a citation so that find and replace can handle reducing any number of names if “et al:” is the ending characteristic?”
Good question, and a nice challenge for a wildcard search. Let’s say we have citations with strings of names like this:
Lyon J, Adin R, Carter TO, Jackson TT, Doe J, Smith K, Winger W, et al:
That’s seven names, but let’s see if we can make a wildcard string that will find any number of names and cut them down to three. My first impression is that this might be difficult or even impossible. But let’s try the following wildcard string:
([!^013]@, ){3}([!^013]@, ){1,}(et al:)
Here’s what that means:
- Find any character except a carriage return: [!^013] repeated any number of times: @ followed by a comma followed by a space and enclosed in parentheses to form a “group.”
- Do that three times in a row: {3} Find using the same group: ([!^013]@, ) if it occurs once or more (as indicated by the comma): {1,} followed by “et al:” in parentheses to form a group.
There’s just one problem: It doesn’t work. And that’s how it often is with wildcards—sometimes you have to fiddle around to get the result you want; trial and error are key. So let’s see if we can find just three instances of text using our group:
([!^013]@, ){3}
That doesn’t work either. Let’s try using the group three times in a row:
([!^013]@, )([!^013]@, )([!^013]@, )
That does work. So why not this?
([!^013]@, ){3}
Specifying a number (like {3}) has always worked in other situations, so why not here? Let’s try using the same wildcard string to find the first three names if the names are all identical (yes, weird, but we’re testing here):
Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, Lyon J, et al:
Sure enough, that works! What in the world is going on?
Aha, aha! I’ve got it! It’s the @ that’s causing this weird behavior. We haven’t provided a specific string of characters for {3} to find; instead, the @ grabs the characters in front of the comma, and they become the specific string of characters that {3} tries to find (three times in succession). That specific string of characters doesn’t exist three times in succession in our original citation, so naturally Word can’t find it three times in succession. Whew!
Well, okay, then. For our current purposes, we’ll stop using numbers (such as {3}) to specify how many times our pattern should be repeated. Let’s try this instead:
([!^013]@, [!^013]@, [!^013]@, )[!^013]@(et al:)
Here’s what that means:
- Find any characters except a carriage return: [!^013] repeated any number of times: @ followed by a comma followed by a space repeated three times and enclosed in parentheses to form a “group".
- Then find any character except a carriage return: [!^013] repeated any number of times: @ followed by “et al:” in parentheses to form a group.
Well, son of a gun; that actually works. So now we can use the following in the “Replace with” box:
\1\2
Here’s what that means:
Replace everything that was found with the text represented by group 1: \1 followed by the text represented by group 2: \2
Group 1, you’ll remember, was this:
([!^013]@, [!^013]@, [!^013]@, )
It finds the first three names in our citations. And group 2 was this:
(et al:)
It finds the end of our citations.
Sometimes the easy way isn’t so easy. Nevertheless, it’s almost always worth pursuing. In this case, it reduced the client’s editing time from hours (removing extraneous names by hand) to minutes (removing the names with a wildcard find and replace). Plus, it provided a deeper and clearer understanding of how to use wildcard searches.
This is just one example of how wildcards can be used to fix citations, I encourage you to take this newfound knowledge and see what other wildcard strings you can make to fix other citation issues.
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!
This ebook, a $10 value, is available free. Get it while you can. Download your copy now!