MS Word Wildcard Search

MonteDelMar
MonteDelMar used Ask the Experts™
on
I am trying to search a document for numbers that could be anything from 1 (or 1.) to 999.999.999.999.999. Is there any way that I can do this, say using wildcards, without needing to use several passes?

Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Wesley MillerComputer Network Analyst

Commented:
Within Word , Home Tab, on Far Right Click FInd.
Under Navigation Click on the Magnifying Glass Icon.
Click on Advanced Find
Click on Wildcards

For Word,  The question mark and asterisk are wildcard characters that represent characters in the search text. The question mark matches any single character; the asterisk matches any group of characters (commonly called a text string ).

Author

Commented:
Thank you for your reply but I do not quite see how I translate that into the string I need. Is there a way I can use a single search to find a range of numbers with the below example formats?

1.
10.1
100.11.1
1.10.14.12

At the moment I run several searches. For example:

1.1.1.1.1 or 999.999.999.999.999 would be [0-9]{3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}

1.1.1 or 999.999.999 would be [0-9]{3}.[0-9]{1,3}.[0-9]{1,3}.

Is there a better way?
Wesley MillerComputer Network Analyst

Commented:
For that you would use a Macro,
This link provides details on doing that: https://www.techrepublic.com/article/macro-trick-how-to-highlight-multiple-search-strings-in-a-word-document/
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Rob HensonFinance Analyst

Commented:
Try this from Office Tools

https://www.officetooltips.com/word_2016/tips/using_wildcards.html

Looks like that is what you are already doing with your 0-9 search.
Retired
Top Expert 2012
Commented:
Does a search for

[0-9.]{1,}

work in your scenario?

Author

Commented:
Thank you all for your ideas. Thanks, Graham. That several lines of VBA code I can wipe out.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial