View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
A.N.
 
Posts: n/a
Default Find ! in document and remove

Solved. A basic part of code writing overlooked, pardon me, here it is for
others:

Example: ([a-z][!][spacebar][a-z])

Interpretation: will find the end of a presumed sentence or word with an !
then a space before a new sentence, however the next sentence was in
lowercase as well.

Sample: "end of a sentence! start of another"

I needed to remove the ! mark. The above code did work to find it as
prescribed, but I could not figure out how to remove the !.

Now for the miserably simple overlook. In all the examples it was not clear
what "\1" or "\2" meant. Place holder I guess, IF they are designated with
( ) brackets.

Corrected Example: ([a-z])([!])([spacebar-literally])([a-z]) Now each item
is enclosed in brackets.

There are four sets of brackets, therefore four place holders so-to-speak.

Replace code therefore is a simple - I want to keep brakets or space holders
\1\3\4 and wala, it worked. I imagine there is some redundancy in that
search code though. An expert could provide the most correct rendering.

-End


"marrie" wrote in message
...
Yikes! You wrote that code yourself? in the VB editor? I don't know how to
use that as of yet.
Seen it all, done it all, can't remember most of it

"A.N." wrote in message
...
I have the find code correctly as this: ([a-z][!][spacebar][a-z])

How to write the replace code without the !

Thanks.


"marrie" wrote in message
...
I would find the exclaim mark and then look at each one to see if that's
what you want to remove. It is a bit tedious but that's what I can come
up with for now.

--
This is a message from God: "Rebooting the universe, please log out"

"A.N." wrote in message
...
How do I find all ! in a document where there is a lowercase letter on
its left and a space and lower case letter on its right and then remove
it?

Example: end! another sentence

Thanks again.