Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
finding specific sequence of wildcard characters
I'm using Word 2007 on Vista Business. In a word document, I'd like to find
single instances of the "*" character (i.e., the asterisk character). The document contains several single "*" characters as well as double "**" and triple "***" sequences (each of these asterisk sequences is also followed by a different sequence of numbers). But I only want to find the singles, not the doubles or triples. I've tried the following three searches with wildcards on: \*{1} [\*]{1} (\*){1} In each case, word finds every "*" character, including those contained in doubles or triples. Does anyone know of a way to just find instances of the single "*" character? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
finding specific sequence of wildcard characters
bdr122 wrote:
I'm using Word 2007 on Vista Business. In a word document, I'd like to find single instances of the "*" character (i.e., the asterisk character). The document contains several single "*" characters as well as double "**" and triple "***" sequences (each of these asterisk sequences is also followed by a different sequence of numbers). But I only want to find the singles, not the doubles or triples. I've tried the following three searches with wildcards on: \*{1} [\*]{1} (\*){1} In each case, word finds every "*" character, including those contained in doubles or triples. Does anyone know of a way to just find instances of the single "*" character? Put yourself in the place of the little man inside the computer who has to carry out your instructions. Scanning through the document, he sees an asterisk character and highlights it. Then he moves one character to the right, and there's another asterisk, so he highlights that one -- you haven't told him not to. One more character to the right, "Oh, look, there's another one!" And so it goes. To limit the matches to single asterisks, you have to be very literal and give the instruction "find one asterisk where the character to its left is not an asterisk, and the character to its right is not an asterisk". In wildcard syntax, [!\*][\*][!\*] Of course, this is going to highlight all three characters. If you're doing only a find, there's not much harm in that. If you're doing a replacement, though, and you want to do something with the asterisk, you need to modify the search expression to put parentheses around each bracketed term ([!\*])([\*])([!\*]) and use a replace expression like \1something\3 so the preceding and following characters don't change. Or you may need to program a macro to do only a find, and then do some more complicated processing of the matched characters -- for example, if you want to change the formatting of the asterisk but not of the surrounding characters. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
finding specific sequence of wildcard characters
Another trick that's sometimes helpful:
Search two or more asterisks and hide them. Find what: [\*]{2,} Replace with: ^& ((+FormatFontHidden)) Then set your display to not show hidden text (ToolsOptionsView). Only single asterisks should now be visible, and if you do any Find or Replace, it'll ignore the hidden asterisks. When you're done, you can unhide the multiple asterisks again (either with another Find/Replace, or by selecting everything and unchecking FormatFontHidden). Regards, Klaus |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
finding specific sequence of wildcard characters
Thank you both for your answers. They'll be helpful in the future. In the
mean time, I worked out a solution of my own and I'm including it here in case anyone else might be able to use it. What I was specifically looking for was single asterisks followed by one or two numbers and bounded by brackets. For example: [*4] or [*12], but not things like [**4] or [***4]. (Anyone who works with legal documents might recognize these as "star paging" sequences). The search string I eventually came up with, which worked well, was: \[\*[1-9]{1,2}\] In the "replace" field, I just used the format "highlighting" and this had the effect of highlighting the correct instances of "star paging" throughout the document. This may be an inelegant solution, but it got the job done. |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
finding specific sequence of wildcard characters
Isn't "full disclosure" a requirement of any legal process? If you'd
put in the numbers and square brackets in the first place, the solution would have been a lot simpler. On May 9, 11:19*am, bdr122 wrote: Thank you both for your answers. They'll be helpful in the future. In the mean time, I worked out a solution of my own and I'm including it here in case anyone else might be able to use it. What I was specifically looking for was single asterisks followed by one or two numbers and bounded by brackets. For example: [*4] or [*12], but not things like [**4] *or [***4]. (Anyone who works with legal documents might recognize these as "star paging" sequences). The search string I eventually came up with, which worked well, was: \[\*[1-9]{1,2}\] In the "replace" field, I just used the format "highlighting" and this had the effect of highlighting the correct instances of "star paging" throughout the document. This may be an inelegant solution, but it got the job done. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Finding text at a specific place | Microsoft Word Help | |||
Wildcard replacement of characters and style | Microsoft Word Help | |||
Finding & Replacing Characters using wildcards | Microsoft Word Help | |||
Finding higlights with a specific color | New Users | |||
finding special characters | New Users |