can find & replace interpolate?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Mike Trittipo

can find & replace interpolate?

Post by Mike Trittipo »

I have several Listserv archives to edit, typically 2-3 MB each. I want to replace all equals-signed hex codes for accented characters with the characters themselves. For example, I want to replace =E9 with \xe9, where the latter -- if entered as a regular expression just that way -- produces e with an acute accent (é); to replace =E7 with \xe7 (ç), and so forth in the range E0-FF.

My first stab was to find

=\([a-f][0-9a-f]\)

and to replace with

\x\1

But that just gave me \xe9, etc., not é, ç, etc. (If I find & replace =e9 with \xe9, and then find & replace =e7 with \xe7, etc., it works -- so I suppose I could write a macro with 128 finds and replaces from e0 to ff -- but I'd rather find out if there's a way to do it this way.)

I think the problem (well, the reason why I can't do it the way I hoped for) is that the replace side is replacing in a string context, and is not first letting the \1 string be treated as a number, then evaluating \x_that_number by interpolation.

Is there a way in Textpad's regular expressions for replacement to get the hex \xe9 put in instead of the literal string \xe9? I've searched Textpad's help, and searched past find&replace and regex queries in this forum, and I don't see that there is. TIA!
Post Reply