in reply to Regex from string
You need qr here and escape right paranthesis. Also have a look at perlre.
my $line = "root (hd1,1)"; my $match = qr/root \(hd[0-9],[0-9]\)/; if ($line =~ m/$match/is) { print "match 1 found \n"; }
updated: changed qw to qr. Zaxo++ Thanks.
Prasad
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex from string
by Zaxo (Archbishop) on May 31, 2006 at 10:39 UTC |