Backreferences on substitution?
Andre Costa <[email protected]> Mon, 2 Jun 2003 20:48:28 -0300
| Newsgroups | gmane.comp.jakarta.regexp.user |
|---|---|
| Organization | nTime |
| Message-ID | <[email protected]> |
Hi all, it seems the archives are unreachable, so I will fire this question without having first searched for an existing answer... please bear with newbie ignorance ;) Is it possible to specify backreferences on substitution patterns? The probl is: I would like to get rid of some tags but leave their content untouched. This pattern correctly catches data on the form <tag ...>data</tag>: <([:alpha:]+)[^>]*>([^<]*)</\1> However, if I want to use it on a text where it appears multiple times with RE.subst(), how do I pass a backreference to the second capture to the 'substitution' parameter? For example, this text <tag1>this text</tag1> should <tag2>remain untouched</tag2> should become this text should remain untouched Any clues? What am I missing? TIA Andre -- Andre Oliveira da Costa