View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Wildcard Search and Replace

Hi Johann,

You could perhaps try:
([A-Z]{3})(/)([A-Z]{3}) as the Find, with
\1 \2 \3 as the Replace.
Note: the and prevent the Find from processing strings of 4 or more letters.

--
Cheers
macropod
[Microsoft MVP - Word]


"Johann Swart" wrote in message ...
I have "inherited" a set of documents that exhibit a rather strange behaviour.
In these documents three-letter codes are listed in the form ABC/DEF. I want
to change these to ABC / DEF (i.e. [code][hardspace][forward
slash][hardspace][code]). In the Word Search and Replace I select Use
Wildcards. I then enter in the Find What line: ([A-Z]{3})/([A-Z]{3}) and in
the Replace With line \1^s/^s\2.
The result is this (surprisingly!): ABCDEF /.
When I create a new test document to replicate this situation, the result is
as expected, i.e. ABC / DEF.
Has anyone ever experienced a situation similar to this? The problem
obviously lies with the document itself and not the PC or Word. Has anyone
any idea what is going on here and how one can remedy this peculiarity?