Find using Wildcards, Special Characters

User avatar
omega0401
StarLounger
Posts: 84
Joined: 13 Mar 2010, 18:17

Find using Wildcards, Special Characters

Post by omega0401 »

I am trying to find a two digit number that starts with a period OR a quote mark. I use the following search string: [."]^#^#

This search fails. It appears you can not combine wild characters and special characters in the same search. If that is true, is there another way to accomplish this?

User avatar
HansV
Administrator
Posts: 78463
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Find using Wildcards, Special Characters

Post by HansV »

Using wildcards, you can enter [."][0-9][0-9] in the Find What box, or alternatively [."][0-9]{2,2}
Best wishes,
Hans

User avatar
omega0401
StarLounger
Posts: 84
Joined: 13 Mar 2010, 18:17

Re: Find using Wildcards, Special Characters

Post by omega0401 »

HansV wrote:Using wildcards, you can enter [."][0-9][0-9] in the Find What box, or alternatively [."][0-9]{2,2}
Thanks Hans. I totally forgot all about using the number range as a wildcard. I tried both methods and they find the period and number but for some reason they do not find the quote and number. Does this work for you or do you get the same results I got? I’m currently on Word 2002 but it should still work.

User avatar
HansV
Administrator
Posts: 78463
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Find using Wildcards, Special Characters

Post by HansV »

Using wildcards, [."][0-9][0-9] will find both a period followed by two digits and a quote followed by two digits:
x90.png
(This is in Word 2007, but I see no reason why it shouldn't work in earlier versions)
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
omega0401
StarLounger
Posts: 84
Joined: 13 Mar 2010, 18:17

Re: Find using Wildcards, Special Characters

Post by omega0401 »

Thanks for confirming that. I did the same exact thing in the Find What box as your example and Wildcards are turned on. Yet it skips the quote and the numbers but was successful finding the period and numbers. Another mystery. I'll keep experimenting with it and maybe I'll get lucky and find the reason.

User avatar
omega0401
StarLounger
Posts: 84
Joined: 13 Mar 2010, 18:17

Re: Find using Wildcards, Special Characters

Post by omega0401 »

Does anyone have Word 2002 and could you run a quick test to see if it works for you? I would expect it does but it would be helpful to confirm that. If it doesn't work, it will save me time trying to figure out what's wrong.

User avatar
StuartR
Administrator
Posts: 12604
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Find using Wildcards, Special Characters

Post by StuartR »

omega0401 wrote:Thanks for confirming that. I did the same exact thing in the Find What box as your example and Wildcards are turned on. Yet it skips the quote and the numbers but was successful finding the period and numbers. Another mystery. I'll keep experimenting with it and maybe I'll get lucky and find the reason.
Is it possible that your document has a "curly quote" rather than a straight one. This is a different character so would not match.
StuartR


User avatar
omega0401
StarLounger
Posts: 84
Joined: 13 Mar 2010, 18:17

Re: Find using Wildcards, Special Characters

Post by omega0401 »

StuartR wrote:
omega0401 wrote:Thanks for confirming that. I did the same exact thing in the Find What box as your example and Wildcards are turned on. Yet it skips the quote and the numbers but was successful finding the period and numbers. Another mystery. I'll keep experimenting with it and maybe I'll get lucky and find the reason.
Is it possible that your document has a "curly quote" rather than a straight one. This is a different character so would not match.
You are right Stuart. I had curly quotes set. Thank you much for that solution.

What threw me off was if I just type only a quote in the Find What box and nothing else and wildcards turned off, it will find the curly quote. Now if I type just [“] with wildcards turned on, it does not find the quote. The search is behaving differently if I use wildcards or not. I was expecting consistent behavior. Since it can find a curly quote in the first example, I didn’t suspect a curly quote problem. This was interesting.

User avatar
HansV
Administrator
Posts: 78463
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Find using Wildcards, Special Characters

Post by HansV »

If "Use wildcards" is turned on, characters that don't signify a pattern are taken much more literally. For example, "Match case" is automatically applied. Similarly, straight and curly quotes are seen as different.
Best wishes,
Hans