Wild Card use in Express

Have a problem? A question? This is the place for answers from other Express users.
Post Reply
JFKAR
Posts: 4
Joined: 2009-01-09 03:39:13

Wild Card use in Express

Post by JFKAR » 2009-01-09 04:02:34

In Express I can't figure out how to Replace with what used to be called 'Found 1', 'Found 2', 'Found 3' etc when I've searched using more than one wild card in a string.

Just using 'Found' to leave various letters or digits unchanged in Replace doesn't work.

Here is an example:
I want to find all instances where a hypen is used with a space either side of it, between numbers and letters as in:
9am - 3pm
I want to change the hyphens to the HTML code for an en dash: –

So I've input:
Find what: [[:alpha:][:digit:]] - [[:alpha:][:digit:]]
Replace with: \0–\0

This yields a correct find, e.g. m - 3
But it replaces that with: m - 3–m - 3
Instead of: m–3

(I hope this makes sense!)

User avatar
Hamid
Posts: 734
Joined: 2007-01-17 03:25:42

Re: Wild Card use in Express

Post by Hamid » 2009-01-09 05:44:33

Does this set of PowerFind Pro find/replace expressions work the way you want?:

Find:
([[:alpha:][:digit:]])( - )([[:alpha:][:digit:]])

Replace:
\1–\3

JFKAR
Posts: 4
Joined: 2009-01-09 03:39:13

Re: Wild Card use in Express

Post by JFKAR » 2009-01-16 06:10:53

Yes, Hamid: that works perfectly. Many thanks! :)

Post Reply