On 27 Sep 2000, Piers Cawley wrote: > > Do we *want* to maintain \1? Why have two notations to do the > > I'm kind of curious about what happens when you want to do, say: > > if (m/(\S+)/) { > $reg = qr{<(em|i|b)>($1)</\1>}; > } > > where the $1 in the regex quote is refering to $1 from the previous > regex match. Well, how about this: $reg = qr{<(em|i|b)>(${P1})</\1>}; NOTE: ^^^^^ If you assume that $1 and ${1} are equivalent (which makes it possible to have as many backrefs as you want), then you could say that, if the first character after the { is a P, it means "in the previous regex match." Dave
- is \1 vs $1 a necessary distinction? Dave Storrs
- Re: is \1 vs $1 a necessary distinction? Jonathan Scott Duff
- Re: is \1 vs $1 a necessary distinction? Dave Storrs
- Re: is \1 vs $1 a necessary distinction? Randal L. Schwartz
- Re: is \1 vs $1 a necessary distinction? Bart Lateur
- Re: is \1 vs $1 a necessary distinction? Michael Maraist
- Re: is \1 vs $1 a necessary distinction? Uri Guttman
- Re: is \1 vs $1 a necessary distinction? Richard Proctor
- Re: is \1 vs $1 a necessary distinction? Dave Storrs
- Re: is \1 vs $1 a necessary distinction? Piers Cawley
- Re: is \1 vs $1 a necessary distincti... Dave Storrs
- Re: is \1 vs $1 a necessary dist... Piers Cawley
- Re: is \1 vs $1 a necessary distinction? Richard Proctor