Re: Matching within the LHS of a regex...

2001-07-30 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 30, David Wood said: >$str = qq( > > some data > some more data > >); > >What I need to do is something like:- > >$str =~ s/]+\n(.*?)<\/udb:$1>/$sub->($1,$2)/gs; Even if you change the $1 to a \1, it won't match, since you have ]+\n when you need ]+>\n -- Jeff "japhy" Pinyan

Re: Matching within the LHS of a regex...

2001-07-30 Thread Peter Scott
At 04:40 PM 7/30/2001 +0100, David Wood wrote: >What I need to do is something like:- > >$str =~ s/]+\n(.*?)<\/udb:$1>/$sub->($1,$2)/gs; > >But putting the $1 on the LHS is not valid... In the regex itself, use \1, \2, etc instead of $1, $2, etc (which would match their values, if any, from the