Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Johann Swart Johann Swart is offline
external usenet poster
 
Posts: 26
Default Wildcard Search and Replace

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?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
grammatim[_2_] grammatim[_2_] is offline
external usenet poster
 
Posts: 2,751
Default Wildcard Search and Replace

Is there a reason not to simply Replace slash with space slash space ?

On May 7, 7:29*am, Johann Swart
wrote:
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?


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Johann Swart Johann Swart is offline
external usenet poster
 
Posts: 26
Default Wildcard Search and Replace

Yes, there are many other slashes in this document to which this exercise
does not apply.

"grammatim" wrote:

Is there a reason not to simply Replace slash with space slash space ?

On May 7, 7:29 am, Johann Swart
wrote:
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?



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Wildcard Search and Replace

There is a bug (fixed in Word 2007) that causes this to happen when Track
Changes is on. Try switching off Track Changes before your Replace and the
turning it back on afterwards.

--
Enjoy,
Tony

www.WordArticles.com

"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?


  #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?



  #6   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

Or, for hard spaces in the replacement:
\1^s\2^s\3

--
Cheers
macropod
[Microsoft MVP - Word]


"macropod" wrote in message ...
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?


  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Wildcard Search and Replace

.. which will still suffer at the hands of the same bug.

--
Enjoy,
Tony

www.WordArticles.com

"macropod" wrote in message
...
Or, for hard spaces in the replacement:
\1^s\2^s\3

--
Cheers
macropod
[Microsoft MVP - Word]


"macropod" wrote in message
...
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?



  #8   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

Perhaps so. It could be that the inherited document is corrupt, or maybe there's an ADVANCE field or something such taking effect
when a space is inserted between the strings..

--
Cheers
macropod
[Microsoft MVP - Word]


"Tony Jollans" My forename at my surname dot com wrote in message ...
.. which will still suffer at the hands of the same bug.

--
Enjoy,
Tony

www.WordArticles.com

"macropod" wrote in message ...
Or, for hard spaces in the replacement:
\1^s\2^s\3

--
Cheers
macropod
[Microsoft MVP - Word]


"macropod" wrote in message ...
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?




  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Johann Swart Johann Swart is offline
external usenet poster
 
Posts: 26
Default Wildcard Search and Replace

Hi TJ, you are 100% correct; I am using TC. And really, I should have guessed
this myself having had similar experiences with TC. I turned TC off and S&R
had the desired effect. Thanks a million for reminding me!

"Tony Jollans" wrote:

There is a bug (fixed in Word 2007) that causes this to happen when Track
Changes is on. Try switching off Track Changes before your Replace and the
turning it back on afterwards.

--
Enjoy,
Tony

www.WordArticles.com

"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?



  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Wildcard Search and Replace

It is not corruption. It is a bug in versions of Word prior to 2007. The
order of replacement literals and found groups is not honoured when Track
Changes is in effect.

--
Enjoy,
Tony

www.WordArticles.com

"macropod" wrote in message
...
Perhaps so. It could be that the inherited document is corrupt, or maybe
there's an ADVANCE field or something such taking effect when a space is
inserted between the strings..

--
Cheers
macropod
[Microsoft MVP - Word]


"Tony Jollans" My forename at my surname dot com wrote in message
...
.. which will still suffer at the hands of the same bug.

--
Enjoy,
Tony

www.WordArticles.com

"macropod" wrote in message
...
Or, for hard spaces in the replacement:
\1^s\2^s\3

--
Cheers
macropod
[Microsoft MVP - Word]


"macropod" wrote in message
...
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?






  #11   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

Ah, I see - I hadn't seen your separate reply to the OP.

Oddly, F/R works correctly when the Find text is itself marked as an addition. Deleted text is left alone if it's hidden, but gets
processed (with the same peculiar results you get for previously-unchanged text) if it's visible.

--
Cheers
macropod
[Microsoft MVP - Word]


"Tony Jollans" My forename at my surname dot com wrote in message ...
It is not corruption. It is a bug in versions of Word prior to 2007. The order of replacement literals and found groups is not
honoured when Track Changes is in effect.

--
Enjoy,
Tony

www.WordArticles.com

"macropod" wrote in message ...
Perhaps so. It could be that the inherited document is corrupt, or maybe there's an ADVANCE field or something such taking effect
when a space is inserted between the strings..

--
Cheers
macropod
[Microsoft MVP - Word]


"Tony Jollans" My forename at my surname dot com wrote in message ...
.. which will still suffer at the hands of the same bug.

--
Enjoy,
Tony

www.WordArticles.com

"macropod" wrote in message ...
Or, for hard spaces in the replacement:
\1^s\2^s\3

--
Cheers
macropod
[Microsoft MVP - Word]


"macropod" wrote in message ...
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?





  #12   Report Post  
Posted to microsoft.public.word.docmanagement
PamC via OfficeKB.com PamC via OfficeKB.com is offline
external usenet poster
 
Posts: 582
Default Wildcard Search and Replace

I'm so glad to hear that it's fixed in W2007. I can't tell you how many
times I've forgotten about that little nuisance and had to undo, turn off
track changes, and redo the sort.

Pam



Tony Jollans wrote:
It is not corruption. It is a bug in versions of Word prior to 2007. The
order of replacement literals and found groups is not honoured when Track
Changes is in effect.

Perhaps so. It could be that the inherited document is corrupt, or maybe
there's an ADVANCE field or something such taking effect when a space is

[quoted text clipped - 27 lines]
anyone any idea what is going on here and how one can remedy this
peculiarity?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ement/200905/1

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
Wildcard Search/Replace Tom K Microsoft Word Help 3 April 21st 09 03:27 PM
Wildcard search want to replace only a portion of what is found Larry Microsoft Word Help 1 April 9th 09 05:38 PM
Wildcard search for *: Ben Bullock New Users 3 October 21st 07 11:36 PM
Can I increment list via wildcard search/replace? Ed Microsoft Word Help 4 September 7th 06 02:56 PM
Help with Wildcard search/replace, please? Ed Microsoft Word Help 1 July 14th 06 12:48 AM


All times are GMT +1. The time now is 07:45 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"