Is there any way to use backreferences _within_ a _pattern_, as works on
some regexp parsing applications, i.e.
'<a href="mailto:([^@]*)@([^"]*)">\\1@\\2</a>'
=>
'\\1@\\2'
so that
<a href="mailto:f...@example.com">f...@example.com</a>
WOULD match and be replaced by f...@example.com
but
<a href="mailto:f...@example.com">b...@example.com</a>
WOULD NOT match (and thus no replacement take place)
?
I can't seem to get this to work. Any suggestions for an alternative?
Martin
> Is there any way to use backreferences _within_ a _pattern_, as works on
> some regexp parsing applications, i.e.
>
> '<a href="mailto:([^@]*)@([^"]*)">\\1@\\2</a>'
> =>
> '\\1@\\2'
Backreferences are obsolete in POSIX 1003.2. PCREs support them.
http://www.tin.org/bin/man.cgi?section=7&topic=regex
--
Jock