Page 1 of 1

Wild Card use in Express

Posted: 2009-01-09 04:02:34
by JFKAR
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!)

Re: Wild Card use in Express

Posted: 2009-01-09 05:44:33
by Hamid
Does this set of PowerFind Pro find/replace expressions work the way you want?:

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

Replace:
\1–\3

Re: Wild Card use in Express

Posted: 2009-01-16 06:10:53
by JFKAR
Yes, Hamid: that works perfectly. Many thanks! :)