View Single Post
  #2   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Find and Replace

On Sun, 8 Mar 2009 17:31:01 -0700, Island Girl
wrote:

While trying to replace all company names in a really long document with
"XXX," it dawned on me that it would be helpful to find two or more words in
a row that begin with capital letters. Greg Maxey set me straight on a
question re word beginnings last week, and this carries that question bit
further.

I know how to find words that start with caps, but how do I find two or more
in a row? I can't figure out where to put the {2,} so that it will find the
words side by side instead of several words apart--which is the result I've
been getting.

I just love this stuff, and it's all because of you, my friends!


You can't use {2,} in this case. If you tried to say "two or more" that way, it
would only find instances where the second word is the same as the first word
(like "Walla Walla"). I don't think there are many company names like that. :-)

You can use this for two words at a time

[A-Z][a-z]@ [A-Z][a-z]@

and this for three at a time

[A-Z][a-z]@ [A-Z][a-z]@ [A-Z][a-z]@

Unfortunately, trying to extend that to four words results in an "expression is
too complex" error, but you can repeat the two- and three-word searches until no
more are found.

--
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.