in reply to regex match with interpolated pattern
You're date variable is using / as the delimiter. As a result you aren't matching the pattern you think you are. You could just use a different delimiter for your pattern.
dsb
This @ISA my cool %SIG
Or you could call quotemeta() on your variable.if ($_ = m%$dm%) { #stuff }
quotemeta() will escape all non-word characters.my $dm = quotemeta($date);
UPDATE: After reading hv's reply, I agree with him. SOmething didn't seem right to me as I was replying...he caught it though :)
dsb
This @ISA my cool %SIG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: regex match with interpolated pattern
by fletcher_the_dog (Friar) on Aug 18, 2004 at 19:49 UTC | |
Re^2: regex match with interpolated pattern
by drock (Beadle) on Aug 18, 2004 at 15:45 UTC | |
by Roy Johnson (Monsignor) on Aug 18, 2004 at 16:21 UTC | |
by Zed_Lopez (Chaplain) on Aug 18, 2004 at 16:27 UTC |
In Section
Seekers of Perl Wisdom