I need to get to find any text which could be alpha numeric in a format of xxxxx-xxxxx-xxxxx-xxxxx-xxxxx or xxxxx xxxxx xxxxx xxxxx xxxxx format, kindly suggest in word wild search
thanks
I need to get to find any text which could be alpha numeric in a format of xxxxx-xxxxx-xxxxx-xxxxx-xxxxx or xxxxx xxxxx xxxxx xxxxx xxxxx format, kindly suggest in word wild search
thanks
Provide some samples please?
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
At its simplest - which is about as complex an expression as a wildcard Find can handle - the expression would be:
<[! \-]{5}([ \-])[! \-]{5}\1[! \-]{5}\1[! \-]{5}\1[! \-]{5}>
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
:Lol...
For what it’s worth, I was shown how to do something similar but more difficult recently, so I can explain this one quite easily now:
A Wild thing is like a pattern to match to try to look for.
In other words you are looking for a type or like or similar to set of characters, rather than an exact specific set of characters.
You have a lot of different Wild things at your disposal to choose from so as to build up a pattern to be looked for.
Some Wild things used here:
[ __ ] _ ( list box )
__ If you were looking not for a wild thing, but rather a specific character, say, y , then you would just type that specific character, y. If you were , however looking for say either of three characters, like a d or c then you need to indicate that either will do. So you would group all options enclosed in a [ ] , like [adc]. You could also for looking for the single character , y , do this [y] __ You do not need to do that, but it does no harm.
Think of this Wild thing as how to give a list of alternatives to be searched for ( or, as we see later , a list of things not to look for ). Or think of it as a list box
( __ )
Let’s say that in a long string that you are looking for, the first character needed to be a d or c. But let’s say that whatever that found character ended up being , you would like to know , so that you could match that specific found character to another later in the long string. So , for example, say you wanted to find anything like these
agheöwa
dnALEKd
cbao45c
So you don’t mind if the first character is a d or c , but you would like to know which was found so as to match that to the last character.
So in our case you would do this:
([adc])
After doing this, you can refer to the single actual found character using
\1 __ Note, the 1 is referring to the first use of a ( __ ) __ If you wish you can put all your wild thing sections, or any combination of sections in a ( __ ) _ You only need to do it for the sections whose found matching character or characters you wish to know about. But it does no harm to put them all in a ( __ ) _ Just remember when referring to any section via_..
\x
_..that x is the sequential number of the ( __ ) sections, counting from the left.
Just to be clear on this one: say we are looking for either
yaa
or
ybb
This would be the way that would typically be done to find this, that is to say, this would be the Wild To Search For string:
y([ab])\1
Here a couple of alternatives: __ (y)([ab])\2___ ([y])([ab])\2
In the last two alternatives, we have the possibility to reference 2 sections: Our Count of sequential Indexes of ( __ ) sections is 2. We only need to refer to the second, and can do this with \2
\
The \ has another use in addition to the sequential index of the ( __ ) sections which was shown above. This other use is to proceed a character which has a specific meaning in wild things, should you wish to use that as a literal character in the search. So for example , if you were looking for a [ , you would need to do this_..
\[
_.. If you did not do this, then Excel would get confused thinking the [ was part of a list box [ __ ]
!
This means in general “ “Not” , or “exclude” , what comes after it “. So !d means anything other than a d
If it is used at the first space of a list box [ __ ] , like this [! __ ] _ then it means anything other than all the characters in the [ _ ] _ So [!adc] would mean any character other than a a d or c
{x} where x is an integer
This means look for x times what is proceeding. So
_ d{2} looks for dd __ Alternatives: [d]{2} __ ([d]){2}
and
_ [ad]{2} looks for aa, ad , dd , or da __ Alternative: ([ad]){2}
_...
That is as much as we need to know to understand the comic book string given in this Thread.
We are looking for alpha numeric in a format of
xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
or
xxxxx xxxxx xxxxx xxxxx xxxxx
We have chosen to break this down into 9 sections. Our strategy is to use appropriate Wild Things to find each of those sections. I give those sections an arbritrary identifying number of 1 – 9. This number is independent of any number, ( Index ) , relating to any used ( __ )The second ( and 4th, 6th and 8th) section ( what I have chosen to call position 2 ) will be a separator (that is to say the in between character found at my positions of 2 4 6 and 8 ). For this we are looking for a![]()
xxxxx - xxxxx - xxxxx - xxxxx - xxxxx 1 2 3 4 5 6 7 8 9
__ space
or a
_ - __
We wish to know what is found at my position 2, so as to look for exactly that again at my position 4 6 and 8. So we will put that second section in a ( __ ). We will not use any other ( __ ) , so the first used ( _ ) counting from the left is referred to via \1 , regardless of where it is. – This number, (1 in this case ) refers to the sequential index of all used ( __ ). I only am using 1 in this case.
Here is the complete break down of the Wild thing
![]()
' http://www.excelforum.com/word-formatting-and-general/1174522-finding-a-particular-word-phrase-in-word.html ' xxxxx-xxxxx-xxxxx-xxxxx-xxxxx or xxxxx xxxxx xxxxx xxxxx xxxxx ‘ ‘ ‘ ' 1 2 3 4 5 6 7 8 9 ' xxxxx - xxxxx - xxxxx - xxxxx - xxxxx ‘ ( or a space at pos 2 4 6 and 8 ): ' xxxxx xxxxx xxxxx xxxxx xxxxx ‘ ‘ ' [! \-]{5}([ \-])[! \-]{5}\1[! \-]{5}\1[! \-]{5}\1[! \-]{5} ‘ ' 1 Not Space or Dash 5 times [! \-]{5} ‘ ' 2 (ref 1) '(make Index1 for later referal) (a space or a dash) ([ \-]) ‘ ' 3 NotSpaceorDash5times [! \-]{5} ‘ ' 4 ref 1 \1 ‘ ' 5 NotSpaceorDash5times [! \-]{5} ‘ ' 6 ref 1 \1 ‘ ' 7 NotSpaceorDash5times [! \-]{5} ‘ ' 8 ref 1 \1 ‘ ' 9 NotSpaceorDash5times [! \-]{5} ‘ ‘ ‘ ' ' http://www.eileenslounge.com/viewtopic.php?f=26&t=26030#p202122 ' http://www.eileenslounge.com/viewtopic.php?f=26&t=26030#p202322 ' https://www.excelforum.com/development-testing-forum/1086445-forum-tools-test-no-reply-needed-4.html#post4583552 ' http://www.excelfox.com/forum/showthread.php/2146-Trying-Blogs-%E0%A4%AC%E0%A5%8D%E0%A4%B2%E0%A5%89%E0%A4%97-%E0%A4%95%E0%A5%8B%E0%A4%B6%E0%A4%BF%E0%A4%B6-%E0%A4%95%E0%A4%B0-%E0%A4%B0%E0%A4%B9%E0%A4%BE-%E0%A4%B9%E0%A5%88-%D8%A8%D9%84%D8%A7%DA%AF%D8%B2-%DA%A9%DB%8C-%DA%A9-160?p=10110#post10110 ' Wilds Card Things.. They make my heart Sing.. They make everything.. Groovy ' http://listenonrepeat.com/watch/?v=Hce74cEAAaE#The_Troggs_-_Wild_Thing ' ‘ What The Fu** are you doing down here? _ I hope you are not a Moderator that does not like my attempts at a bit of Fun.
Alan
Wild things.. they make my heart sing.. they make everything... groovy
http://www.eileenslounge.com/viewtop...=26030#p202122
http://www.eileenslounge.com/viewtop...=26030#p202322
https://www.excelforum.com/developme...ml#post4583552
http://www.excelfox.com/forum/showth...0110#post10110
Wilds Card Things.. They make my heart Sing.. They make everything.. Groovy
http://listenonrepeat.com/watch/?v=H...s_-_Wild_Thing
Last edited by Doc.AElstein; 03-14-2017 at 09:32 AM.
'_- Google first, like this _ site:ExcelForum.com Gamut
Use Code Tags: Highlight code; click on the # icon above,
Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE![]()
http://www.excelforum.com/the-water-...ml#post4109080
https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks