Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2019, 01:26 AM
MikeForward MikeForward is offline Want to do single wildcard search for Z?Z or Z??Z Windows 10 Want to do single wildcard search for Z?Z or Z??Z Office 2010
Novice
Want to do single wildcard search for Z?Z or Z??Z
 
Join Date: Feb 2019
Posts: 10
MikeForward is on a distinguished road
Default Want to do single wildcard search for Z?Z or Z??Z

Hi all



I have inserted a number of special code words into my Word documents, which always take the precise form ZXZABCDE... or ZXYZABCDE...

In detail - 1st char is always a capital Z. This is followed by precisely 1 or 2 capital alphabet characters (including Z), followed immediately by second capital Z (which can therefore be in position 3 or 4 only), followed by any number of alphabet characters (again, maybe including some Z's), all in caps, all one word.

examples:
ZIZAUGCHR
ZVZAQUTRIN
ZQVZDOCET
ZZZMARKER
ZHZCHAP1
ZSZJZZ
ZSVZJZZ

etc

I have tried everything I can think of to wildcard search this without success.

Any help would be much appreciated

Mike
Reply With Quote
  #2  
Old 02-17-2019, 01:38 PM
macropod's Avatar
macropod macropod is offline Want to do single wildcard search for Z?Z or Z??Z Windows 7 64bit Want to do single wildcard search for Z?Z or Z??Z Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use a wildcard Find with:
Find = Z[A-Z]@Z*>
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-17-2019, 10:03 PM
MikeForward MikeForward is offline Want to do single wildcard search for Z?Z or Z??Z Windows 10 Want to do single wildcard search for Z?Z or Z??Z Office 2010
Novice
Want to do single wildcard search for Z?Z or Z??Z
 
Join Date: Feb 2019
Posts: 10
MikeForward is on a distinguished road
Default

Thanks Paul. That certain seems to be better than anything I have come up with, but still fails. It erroneously finds (for example)

ZSDGHASGHASHGZDHFGFT (but according to my spec, there should be a Z in pos 3 or 4 and there isn't)

For the avoidance of doubt, should I be searching with .MatchCase true or false, and .MatchWholeWord true or false?

Thanks

Mike
Reply With Quote
  #4  
Old 02-18-2019, 12:09 AM
macropod's Avatar
macropod macropod is offline Want to do single wildcard search for Z?Z or Z??Z Windows 7 64bit Want to do single wildcard search for Z?Z or Z??Z Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, use:
Find = Z[A-Z]{1,2}Z*>
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-18-2019, 01:21 AM
MikeForward MikeForward is offline Want to do single wildcard search for Z?Z or Z??Z Windows 10 Want to do single wildcard search for Z?Z or Z??Z Office 2010
Novice
Want to do single wildcard search for Z?Z or Z??Z
 
Join Date: Feb 2019
Posts: 10
MikeForward is on a distinguished road
Default sorry that doesn't work either

It now fails to find ZAZDEF. Please keep trying!
Reply With Quote
  #6  
Old 02-18-2019, 03:08 AM
macropod's Avatar
macropod macropod is offline Want to do single wildcard search for Z?Z or Z??Z Windows 7 64bit Want to do single wildcard search for Z?Z or Z??Z Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Find = Z[A-Y]{1,2}Z*>
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 02-18-2019, 03:35 AM
MikeForward MikeForward is offline Want to do single wildcard search for Z?Z or Z??Z Windows 10 Want to do single wildcard search for Z?Z or Z??Z Office 2010
Novice
Want to do single wildcard search for Z?Z or Z??Z
 
Join Date: Feb 2019
Posts: 10
MikeForward is on a distinguished road
Default

Sorry no! Fails to find ZZZMARKER which is a valid code. You can stop if you want as I have come up with a workaround. Or you can keep going for your own sense of achievement. Thanks a lot for trying in any case! Kind regards, Mike
Reply With Quote
  #8  
Old 02-18-2019, 04:21 PM
macropod's Avatar
macropod macropod is offline Want to do single wildcard search for Z?Z or Z??Z Windows 7 64bit Want to do single wildcard search for Z?Z or Z??Z Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It seems to me the goal posts keep moving...
My 1st solution correctly handled all the examples you gave
My 2nd solution correctly handled all the examples you originally gave, plus your additional one
My 3rd solution correctly handled all the examples you had previously given plus your latest one.
If you're not going to specify exactly what you want up-front, it's somewhat churlish to keep coming back saying the solutions offered don't address issues you hadn't bothered to identify until then.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 02-19-2019, 01:21 AM
MikeForward MikeForward is offline Want to do single wildcard search for Z?Z or Z??Z Windows 10 Want to do single wildcard search for Z?Z or Z??Z Office 2010
Novice
Want to do single wildcard search for Z?Z or Z??Z
 
Join Date: Feb 2019
Posts: 10
MikeForward is on a distinguished road
Default

I'm really not being churlish at all, and the goalposts have not moved at all . If you read through the original specification, I think it was clear - I went out of my way to make it as clear as I could. None of your three solutions satisfy those criteria, either rejecting what they should accept, or accepting what they should reject.

Your 1st attempt accepted ZSDGHASGHASHGZDHFGFT when it shouldn't have (no Z in pos 3 or 4). Your 2nd attempt rejected ZAZDEF, when it should have accepted it (it meets all my criteria). Your 3rd attempt rejected ZZZMARKER, which also meets all my criteria.

Never mind, as I said, I have a workaround. I don't want to fall out about this. Thank you very much for trying to help.

Kind regards
Mike

Last edited by MikeForward; 02-19-2019 at 01:21 AM. Reason: typo
Reply With Quote
  #10  
Old 02-19-2019, 01:27 AM
MikeForward MikeForward is offline Want to do single wildcard search for Z?Z or Z??Z Windows 10 Want to do single wildcard search for Z?Z or Z??Z Office 2010
Novice
Want to do single wildcard search for Z?Z or Z??Z
 
Join Date: Feb 2019
Posts: 10
MikeForward is on a distinguished road
Default

Actually Paul, there is slight ambiguity in my spec, for which I apologise.

The original said "I have inserted a number of special code words into my Word documents, which always take the precise form ZXZABCDE... or ZXYZABCDE...

In detail - 1st char is always a capital Z. This is followed by precisely 1 or 2 capital alphabet characters (including Z), followed immediately by second capital Z (which can therefore be in position 3 or 4 only), followed by any number of alphabet characters (again, maybe including some Z's), all in caps, all one word."

I would perhaps now edit it as follows "I have inserted a number of special code words into my Word documents, which always take the precise form ZXZABCDE... or ZXYZABCDE...

In detail - 1st char is always a capital Z. This is followed by precisely 1 or 2 capital alphabet characters (which could be Z), followed immediately by capital Z (therefore position 3 or 4 must contain Z), followed by any number of alphabet characters (again, maybe including some Z's), all in caps, all one word.
Reply With Quote
Reply

Tags
wildcard

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to do single wildcard search for Z?Z or Z??Z Wildcard search once worked, now does not Peterson Word 2 09-17-2018 07:17 AM
Sumif to find a single word in a cell without using wildcard kiteman Excel 3 08-23-2017 10:14 AM
Issue with wildcard search mysterytramp Word 0 05-13-2015 10:40 AM
Want to do single wildcard search for Z?Z or Z??Z Tricky wildcard search NobodysPerfect Word 10 03-19-2014 04:29 AM
Wildcard search help. Kempston Word 0 11-13-2009 03:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft