Categories
Interior

How to use wildcards when searching in word 2016

In computing, a wildcard refers to a character that can be substituted for zero or more characters in a string. Wildcards are commonly used in computer programming, database SQL search queries, and when navigating through DOS or Unix directories via the command prompt.

Below are some popular uses for wildcards:

  • Regular Expressions – A period (.) matches a single character, while .* matches zero or more characters and .+ matches one or more characters.
    Example: $pattern = “Mac(.*)”
  • SQL Queries – A percent symbol (%) matches zero or more characters, while an underscore (_) matches a single character.
    Example: SELECT * FROM Computers WHERE Platform LIKE ‘Mac%’
  • Directory Navigation – An asterisk (*) matches zero or more characters, while a question mark (?) matches a single character.
    Example: dir *.exe

In the examples above, wildcards are used to search for partial matches instead of exact matches. This can be helpful when searching for files or looking up information from a database.

Updated: May 26, 2010

Cite this definition:

TechTerms – The Tech Terms Computer Dictionary

This page contains a technical definition of Wildcard. It explains in computing terminology what Wildcard means and is one of many technical terms in the TechTerms dictionary.

All definitions on the TechTerms website are written to be technically accurate but also easy to understand. If you find this Wildcard definition to be helpful, you can reference it using the citation links above. If you think a term should be updated or added to the TechTerms dictionary, please email TechTerms!

Subscribe to the TechTerms Newsletter to get featured terms and quizzes right in your inbox. You can choose to receive either a daily or weekly email.

‹ Wiki | WiMAX ›

Sign up for the free TechTerms Newsletter

Thank You

We just sent you an email to confirm your email address. Once you confirm your address, you will begin to receive the newsletter.

If you have any questions, please contact us.

The question mark matches any single character; the asterisk matches any group of characters (commonly called a text string). Word looks past the asterisk to see whether any other characters limit the search.

For example, searching for wo*d finds text such as word, world, and worshipped.

Press Ctrl+H to open Find and Replace dialog box:

How to use wildcards when searching in word 2016

To use wildcard characters, click the More > > button, and select the Use wildcards checkbox in the Find and Replace dialog box:

How to use wildcards when searching in word 2016

These wildcards are handy for finding words that you don’t know how to spell.

For example, if you are not sure how to spell receive, you can type rec??ve. Word then locates any word that begins with rec, followed by any two characters followed by ve.

Search Operators

  • ? – Any single character.

For example, d?g finds dig, dog, and dug, but not drug and ridge.

* – Zero or more characters: finds a word with the specified characters and zero or more characters in place of *.

For example, des*t finds descent, desert, destiny, dessert, and destruct and even excludes the, codes – to.

– End of the word.

For example, ion> finds aggravation, inspiration, and institution, but not ionic and bionomics.

@ – Preceding one or more: finds one or more of the characters immediately preceding the @ sign.

For example, ^[email protected]^t finds one or more paragraph break marks followed by a tab mark.

[] – One of the specified characters.

For example, b[aeiu]t finds bat, bet, bit, and but, but not debt and boot.

[-] – Any character from the range.

For example, [a-m]end finds bend, fend, lend, and mend (the first character in this case is a, m, or any letter between them), but not rend and end.

[!] – Not: finds the text but excludes the characters inside the brackets.

For example, t[!ae]ll finds till and toll but not tall and tell.

[!a-z] – Any single character except the ones in the range inside the bracket.

For example, m[!o-z]st finds mast and mist, but not most or must.

– Exact number of occurrences: finds the specified number of occurrences of the letter immediately before the <.

For example, to finds too and tool but not to.

– Minimum number of occurrences: adding a comma after the number tells Word to look for at least that number of occurrences.

For example, a finds four or more of the letter a in a row.

Note: In this example, commas work as a list separator. If you see the Word message that an invalid character has been used, your configurations use another symbol as a list separator, usually, a semi-colon. Consequently, all list-delimiting commas need to be replaced (e.g., for you would need to use ). See also how to change the list separator in Windows 10.

– Minimum and maximum number of occurrences.

For example, 10 finds 100 and 1000, but not 10.

() – Expression: lets you “nest” search expressions within a search term.

For example, finds presorted and prevented, but not repressed and precedent.

If you have any questions or suggestions, please feel free to ask OfficeToolTips team.

A “wildcard,” in the context of Microsoft Word, is a character that allows you to refine a search within a document. But how can you use them? And which symbols can you use? In this article, we run through the basics of wildcards in Microsoft Word and how you can use them to search for specific information in a document.

Using Wildcards in Microsoft Word

The process for enabling wildcards in Word is straightforward:

  1. Press Ctrl+H to bring up the Find and Replace dialogue box.
  2. Click on More >> and make sure the Use wildcards box is checked.

Once enabled, you can also use wildcards in Word’s search-only feature (Ctrl+F).

To use wildcards after enabling them, all you have to do is add the relevant symbol to your search term(s). For example, to search for the words “dive” and “dove” at the same time, you would type “d?ve” into the search field since the “?” symbol can stand in for any character. Word will then search for all words that begin with “d” and end in “ve” with a single character inbetween, including “dive” and “dove.”

Find this useful?

Subscribe to our newsletter and get writing tips from our editors straight to your inbox.

Now, let’s look at some more examples of useful wildcards.

Wildcards to Use in Your Searches

Key wildcards you can use when searching a Word document include:

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, you’ll learn how to use “@” and “?” in your word wildcard searches.

Using “@” and “?” in Wildcard Searches

What if you wanted to search a document to find every three-letter combination starting with b and ending with t—“bet,” “but,” “bit,” ”bat,” and so on? You can do that with a wildcard!

Search this wildcard:

Now let’s say we wanted to find the same characters but add others as well. For example, we might want to find every three-letter combination starting with b and ending with d—“bed,” “bud,” “bid,” “bad,” and so on—in addition to the combinations ending in t. Can we really do that? Sure! We’ll start by entering the letter b into the “Find what” box, telling Microsoft Word to find that letter.

Next, we’ll enter the ? wildcard, which tells Microsoft Word to find any single character.

Finally, we’ll enter a new wildcard:

Microsoft Word will find any one of the characters specified in the brackets (in this case, either t or d). Characters specified in this way are called a “range.”

Altogether, the string of characters looks like this:

That particular combination tells Microsoft Word to find the letter b followed by any other single character followed by t or d.

How can something like this help you? Suppose you’re editing a manuscript in which the author has misspelled a name in nearly every way possible. You could comb through the manuscript over and over, hoping to catch all the variations. Or, you could be sure to catch them all by searching with wildcards. For example, let’s say your manuscript is a book about India and the name in question is Gandhi. Your author has misspelled it as “Ghandi,” “Gahndi,” and “Ganhdi.” (Not possible? Hah!) You can find every last one of them with the following string:

Then, if you’ve put the correct spelling, “Gandhi,” in the “Replace with” box, you can find and replace each wrong spelling with the right one in a single pass, which is much more efficient than finding and replacing each variation separately.

You may be wondering why you couldn’t just use the * wildcard to represent the whole string of letters, like this:

You could. But the * wildcard represents any string of characters—including spaces and carriage returns. It’s not limited to characters within a word (and neither are other wildcards). That means, in addition to finding the misspelled names, it will find the first 14 characters of the following phrase: “Go to the officer’s hall.” So be careful, especially if you’re planning to use “Replace All” rather than finding and replacing one item at a time.

There is a way to simplify the wildcard combination, however.

Consider this string:

It’s functionally the same as this:

The <4>tells Word to find exactly four occurrences of the previous “expression,” which is [andh].

But now a complication: Suppose that our slapdash author has also spelled Gandhi’s name as “Gandi.” Uh-oh. Our original string won’t catch that, because this new misspelling is one character shorter than our string specifies. But consider this:

The <3,4>tells Word to find from 3 to 4 occurrences of the previous expression, so this string will catch all of our misspelled variations so far.

What if we want to allow for more or fewer characters, being particularly unsure of our author? We can use this string:

The @ wildcard tells Microsoft Word to find one or more occurrences of the previous expression (if there are any) until it reaches an i. That ought to cover nearly anything our author throws at us. If we want to get a little more specific, we can use <3,>, which tells Word to look for at least three occurrences of the previous expression.

Here’s a tip: What would happen if we put a lowercase g rather than a capital G at the beginning of our string? Word wouldn’t find the misspelled names. Why? Because with “Use wildcards” turned on, Word automatically matches case—a useful thing to know.

Continue Your Wildcard Education: Free Download!

Ready to learn even more about Word wildcards?

Download theWildcard 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!

The question mark matches any single character; the asterisk matches any group of characters (commonly called a text string). Word looks past the asterisk to see whether any other characters limit the search.

For example, searching for wo*d finds text such as word, world, and worshipped.

Press Ctrl+H to open Find and Replace dialog box:

How to use wildcards when searching in word 2016

To use wildcard characters, click the More > > button, and select the Use wildcards checkbox in the Find and Replace dialog box:

How to use wildcards when searching in word 2016

These wildcards are handy for finding words that you don’t know how to spell.

Click the Special button, and select the special character or item you want to find and any text for which you want to search:

How to use wildcards when searching in word 2016

For example, if you are not sure how to spell receive, you can type rec??ve. Word then locates any word that begins with rec, followed by any two characters followed by ve.

Search Operators

  • ? – Any single character.

For example, d?g finds dig, dog, and dug, but not drug and ridge.

* – Zero or more characters: finds a word with the specified characters and zero or more characters in place of *.

For example, des*t finds descent, desert, destiny, dessert, and destruct and even excludes the, codes – to.

– End of the word.

For example, ion> finds aggravation, inspiration, and institution, but not ionic and bionomics.

@ – Preceding one or more: finds one or more of the characters immediately preceding the @ sign.

For example, ^[email protected]^t finds one or more paragraph break marks followed by a tab mark.

[] – One of the specified characters.

For example, b[aeiu]t finds bat, bet, bit, and but, but not debt and boot.

[-] – Any character from the range.

For example, [a-m]end finds bend, fend, lend, and mend (the first character in this case is a, m, or any letter between them), but not rend and end.

[!] – Not: finds the text but excludes the characters inside the brackets.

For example, t[!ae]ll finds till and toll but not tall and tell.

[!a-z] – Any single character except the ones in the range inside the bracket.

For example, m[!o-z]st finds mast and mist, but not most or must.

– Exact number of occurrences: finds the specified number of occurrences of the letter immediately before the <.

For example, to finds too and tool but not to.

– Minimum number of occurrences: adding a comma after the number tells Word to look for at least that number of occurrences.

For example, a finds four or more of the letter a in a row.

Note: In this example, commas work as a list separator. If you see the Word message that an invalid character has been used, your configurations use another symbol as a list separator, usually, a semi-colon. Consequently, all list-delimiting commas need to be replaced (e.g., for you would need to use ). See also how to change the list separator in Windows 10.

– Minimum and maximum number of occurrences.

For example, 10 finds 100 and 1000, but not 10.

() – Expression: lets you “nest” search expressions within a search term.

For example, finds presorted and prevented, but not repressed and precedent.

If you have any questions or suggestions, please feel free to ask OfficeToolTips team.

Add-ins frequently need to act based on the text of a document. A search function is exposed by every content control (this includes Body, Paragraph, Range, Table, TableRow, and the base ContentControl object). This function takes in a string (or wildcard expression) representing the text you are searching for and a SearchOptions object. It returns a collection of ranges which match the search text.

Search options

The search options are a collection of boolean values defining how the search parameter should be treated.

Property Description
ignorePunct Gets or sets a value indicating whether to ignore all punctuation characters between words. Corresponds to the “Ignore punctuation characters” check box in the Find and Replace dialog box.
ignoreSpace Gets or sets a value indicating whether to ignore all whitespace between words. Corresponds to the “Ignore white-space characters” check box in the Find and Replace dialog box.
matchCase Gets or sets a value indicating whether to perform a case sensitive search. Corresponds to the “Match case” check box in the Find and Replace dialog box.
matchPrefix Gets or sets a value indicating whether to match words that begin with the search string. Corresponds to the “Match prefix” check box in the Find and Replace dialog box.
matchSuffix Gets or sets a value indicating whether to match words that end with the search string. Corresponds to the “Match suffix” check box in the Find and Replace dialog box.
matchWholeWord Gets or sets a value indicating whether to find operation only entire words, not text that is part of a larger word. Corresponds to the “Find whole words only” check box in the Find and Replace dialog box.
matchWildcards Gets or sets a value indicating whether the search will be performed using special search operators. Corresponds to the “Use wildcards” check box in the Find and Replace dialog box.

Wildcard guidance

The following table provides guidance around the Word JavaScript API’s search wildcards.

To find: Wildcard Sample
Any single character ? s?t finds sat and set.
Any string of characters * s*d finds sad and started.
The beginning of a word (in)> finds in and within, but not interesting.
One of the specified characters [ ] w[io]n finds win and won.
Any single character in this range [-] [r-t]ight finds right and sight. Ranges must be in ascending order.
Any single character except the characters in the range inside the brackets [!x-z] t[!a-m]ck finds tock and tuck, but not tack or tick.
Exactly n occurrences of the previous character or expression fe<2>d finds feed but not fed.
At least n occurrences of the previous character or expression fe<1,>d finds fed and feed.
From n to m occurrences of the previous character or expression 10 <1,3>finds 10, 100, and 1000.
One or more occurrences of the previous character or expression @ [email protected] finds lot and loot.

Escaping the special characters

Wildcard search is essentially the same as searching on a regular expression. There are special characters in regular expressions, including ‘[‘, ‘]’, ‘(‘, ‘)’, ‘<', '>‘, ‘*’, ‘?’, ‘ ‘, ‘!’, and ‘@’. If one of these characters is part of the literal string the code is searching for, then it needs to be escaped, so that Word knows it should be treated literally and not as part of the logic of the regular expression. To escape a character in the Word UI search, you would precede it with a ” character, but to escape it programmatically, put it between ‘[]’ characters. For example, ‘[*]*’ searches for any string that begins with a ‘*’ followed by any number of other characters.

Examples

The following examples demonstrate common scenarios.

How to Use Advanced Find and Replace in Word

How to use wildcards when searching in word 2016

In addition to simply searching for a specified word or phrase, you can use Word’s advanced search features to search using wildcards or search for special characters.

Search with Wildcards

A “wildcard” is a character (or a short string of characters) that represents multiple characters in a search.

  1. Click the Find list arrow.
  2. Select Advanced Find.
  3. Click the More button.

How to use wildcards when searching in word 2016

If you’re familiar with wildcards, you can type them out as part of the search phrase. You can also insert them from a menu.

(Optional) Click the Special menu to select a wildcard.

The wildcard syntax is shown at the top of the list. The syntax can get tricky, and wildcards can be tough to understand without examples. The table on the next page should help explain some common examples.

  • Enter a search phrase in the Find what text field.
  • Click Find Next.

    How to use wildcards when searching in word 2016

    The search is conducted. Make sure to be careful if you’re using wildcard searches to find and replace text. Keep an eye on the results in case something unexpected is found.

    Some common wildcards are shown in the following table.

    Wildcard Purpose Example
    ? Any single character h?t will find hat, hot, and h t
    * Any number of characters a*d will find ad, ahead, and as compared
    [ ] One of these characters t[ai]n will find tan and tin, but not ton
    [ – ] One of these characters in a range [b-d]ot will find bot, cot, and dot
    [! ] Not the specific characters [!d]ust will find rust and must, but not dust
    something, someone, and somewhere
    > The end of a word (one)> will find stone, cone, and provolone
    @ One or more instances of a character [email protected] will find coral and corral
    Exactly n instances of a character ^p will find two consecutive paragraph breaks
    At least n instances of a character 10 will find 100, 1000, and 10000
    Between n and m instances of a character 10 will find only 100 and 1000, not 10000

    Search for Special Characters

    You can also specifically search for special characters, such as line and page breaks, paragraph marks, fields, graphics, and dashes.

    1. Click the Find list arrow.
    2. Select Advanced Find.
    3. Click the More button to expand the dialog box, if necessary.

    If you’ve expanded the Find and Replace dialog box in a recent search, without collapsing it back down, it will open in an expanded state.

    How to use wildcards when searching in word 2016

  • Click in the Find what text field.
  • Click the Special button.

    The Special menu lists the special formatting characters that can be searched for.

    Select a special character.

    When you select a special character from the menu, the text code for that special character is inserted.

    Click the Find Next button.

    How to use wildcards when searching in word 2016

    The next instance of the selected special character is found.

    You can find and replace one special character with another (to replace section breaks with page breaks, for example) on the Replace tab of the Find and Replace dialog box.

    I am using Outlook 2016 and I am amazed that I cannot search partial words. If is search for “oneword” it will only return results that start with “oneword”, but ignores “typeoneword”. My business requires me to search frequently by only partial information, I understand that I can go through the following steps to search partial terms, but it seems way too awkward and takes too much time. Does anyone know an addin, extension or any other solution so that I can search partial terms.

    Current (Awkward) steps.

    Search> Advanced> Field > Message > contains > “Oneword”

    Report abuse

    Welcome to Microsoft Community.

    Outlook 2016 will execute a partial word search only if the search sting is at the beginning of the word. For example, in a word called ‘Melbourne’, Outlook 2016 will be able to search the word if the search string is something like ‘Melb’ or Melbour’ etc.

    However, if the search sting is in the middle of a word or at the end of a word, Outlook 2016 will not be able to search the word.

    To do a partial search for a search string in the middle of the word or at the end of the word, you need to use Advanced Find option in Outlook 2016. Follow these steps to execute a partial search in Outlook 2016 based on Advanced Find. However, this is the only option in Outlook 2016 to execute a partial search.

    Click inside the search box in Outlook 2016.

    Click on Search Tools > Advanced Find > Advanced tab.

    Click on Field > Frequently-used fields > Subject.

    Select Contains in Condition drop-down box.

    In Value add your search string.

    Click on Add to List.

    You may select the search string and click on New Search to execute a partial search.

    How to search (partial word) with wildcard in Outlook?

    You might have noticed that wildcards are not supported by the Instant Search feature in Outlook. For example, you want to search for berry fruits with the keyword of *berry, it won’t find out emails containing the keywords of strawberry, blueberry, cranberry, etc. However, how could we search partial word with wildcards in Outlook? Try below workarounds:

    This method is talking about searching partial word with wildcard in one email in Outlook. Please do as follows:

    1. Shift to the Mail view, and double click to open the email where you will search with wildcard.

    2. Click Message > Find. See screenshot:
    How to use wildcards when searching in word 2016

    3. In the opening Find and Replace dialog box, please click the More button to expand the search options.
    How to use wildcards when searching in word 2016

    4. Go ahead to check the Use wildcards option, type the keyword with wildcard in the Find what box, and then click Reading Highlight > Highlight All. See screenshot:
    How to use wildcards when searching in word 2016
    And now all character strings matching the keyword with wildcard are found and highlighted in the email body. See screenshot:
    How to use wildcards when searching in word 2016

    5. Close the Find and Replace button.

    One click to enable Query Builder and easily search with multiple keywords in Outlook

    Kutools for Outlook can help you enable the Query Builder in Advanced Find dialog box with only one click. Within the Query Builder tab, you can add multiple search keywords, and specify the logical relationship “AND” or “OR” amount these keywords. Click for 60-day free trial without limitation!
    How to use wildcards when searching in word 2016

    Actually, there is no directly workaround to search partial word with wildcard in all emails of a mail folder in Outlook. However, we can configure the advanced find option, and search emails containing the specified partial of keywords in Outlook.

    1. Shift to the Mail view, and open the mail folder where you will search with wildcard.

    2. Press Ctrl + Shift + F keys at the same time to open the Advanced Find dialog box.
    Note: You can also open the Advanced Find dialog box by putting cursor in the Instant Search box and clicking Search > Search Tools > Advanced Find.

    3. In the opening Advanced Find dialog box, please go to the Advanced tab, and:
    How to use wildcards when searching in word 2016
    (1) Click Field > All Mail fields > Subject, Message, or other fields as you need;
    (2) Select the contains from the Condition drop down list;
    (3) Type the partial of keyword you will search into the Value box;
    (4) click the Add to List button.

    And now the customized search criteria is added into the Find items that match these criteria box.

    4. Click the Find now button. And now all emails containing the partial of keyword are found out and listed at the bottom of Advanced Find dialog box. See screenshot:
    How to use wildcards when searching in word 2016

    5. Close the Advanced Find dialog box.

    Tip: In this Video, Kutools tab is added by Kutools for Outlook . If you need it, please click here to have a 60-day free trial without limitation!