in reply to Re: quick question about parenthesis and regular expressions
in thread quick question about parenthesis and regular expressions
Enlil--
Thanks for the reg expression -- it works :)
Thanks for the reg expression -- it works :)
But here's an interesting problem, it seems if i'm using a regular expression with the substitution operator, the value of $1 comes up blank.
Why is that?
What I really want to do is this:
if ($line =~ s/($word(?:s|ed))/<b>$1<\/b>/igm)
assuming that:
$line= "She was very absorbed in her homework."; $word = "absorb";
I want it to match absorbed and but store the value of it in $1 so that I can use it later.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: quick question about parenthesis and regular expressions
by jreades (Friar) on Nov 04, 2003 at 13:32 UTC | |
by Roy Johnson (Monsignor) on Nov 04, 2003 at 18:08 UTC | |
by tilly (Archbishop) on Nov 04, 2003 at 18:49 UTC |
In Section
Seekers of Perl Wisdom