Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
bdr122 bdr122 is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
bdr122 bdr122 is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
grammatim[_2_] grammatim[_2_] is offline
external usenet poster
 
Posts: 2,751
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding text at a specific place Kashif Microsoft Word Help 1 April 11th 08 03:10 PM
Wildcard replacement of characters and style Hans L[_2_] Microsoft Word Help 3 August 1st 07 04:56 PM
Finding & Replacing Characters using wildcards Greg Microsoft Word Help 5 October 20th 06 08:51 PM
Finding higlights with a specific color Peter New Users 4 August 5th 05 11:26 PM
finding special characters New Users 2 June 1st 05 09:51 AM


All times are GMT +1. The time now is 04:31 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"