View Single Post
  #5   Report Post  
Jay Freedman
 
Posts: n/a
Default

To be bloody literal-minded about your request, the Find expression
should be
([0-9]{3,4})(p)
and the Replace expression should be
\1 \2

The {3,4} part of the expression will find times with either three or
four digits. The two sets of parentheses divide the found text into
the numeric part and the p.

Further, if your times include both morning and afternoon, change the
Find expression to
([0-9]{3,4})([ap])

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

On Wed, 24 Aug 2005 18:07:04 -0500, "Suzanne S. Barnhill"
wrote:

You have to divide your "Find what" text into two parts. You then replace
with \1 \2 (that is, the first part, followed by a space, followed by the
second part).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"stuart s" wrote in message
...
Jay,
I have read your post with great interest and I find it enlightning,
however, I cannot relate any of your examples to my problem. I am having

no
problem finding text using wildcards, but replacing the found text with

what
was found + modifications is my problem.

"Jay Freedman" wrote:

stuart s wrote:
I am searching a text document in Word in order to edit out items
that will not import correctly into an Excel Worksheet. The time
format in the text document reads, for example. "430p". I would like
to find all times in this format by seaching with a wildcard in the
format "***p" and replacing with the found characters with a
modification as "*** p". The result of the above example would be
"430 p".

See http://www.gmayor.com/replace_using_wildcards.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org