Search and replace

R

richard.ashdowne

I use Word 2003. How do I search for all examples of hyphens between
two digits (e.g. change 112-14 to 112-14) and replace them with en-
dashes?

I tried replace ^#^37^# with ^= but this deleted the two digits. How
do I just replace these hypens without affecting the digits and
without changing any other hyphens?

Thanks!
 
B

Barry Schwarz

I use Word 2003. How do I search for all examples of hyphens between
two digits (e.g. change 112-14 to 112-14) and replace them with en-
dashes?

I tried replace ^#^37^# with ^= but this deleted the two digits. How
do I just replace these hypens without affecting the digits and
without changing any other hyphens?
Copied from a post by Doug Robbins and modified by me. Any errors are
strictly my fault.

Use a Wildcard Edit>Replace with

([0-9]{1})x(<[0-9]{1})

in the find what box, and with

\1y\2

in the replace with box.

Replace the x and y with the codes for original hyphen and the
en-dash, respectively.

Then click on replace a couple of times to make it does what you want
and when satisfied click replace all.


Remove del for email
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top