#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
You could use a wildcard Find with:
Find = Z[A-Z]@Z*>
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
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 |
#4
|
||||
|
||||
In that case, use:
Find = Z[A-Z]{1,2}Z*>
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
sorry that doesn't work either
It now fails to find ZAZDEF. Please keep trying!
|
#6
|
||||
|
||||
Try:
Find = Z[A-Y]{1,2}Z*>
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
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
|
#8
|
||||
|
||||
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] |
#9
|
|||
|
|||
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 |
#10
|
|||
|
|||
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. |
Tags |
wildcard |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
Tricky wildcard search | NobodysPerfect | Word | 10 | 03-19-2014 04:29 AM |
Wildcard search help. | Kempston | Word | 0 | 11-13-2009 03:58 AM |