Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I've also tried the string statement as the followingmy $str = "Hello my name is Kevin"; my $regex = $form->query(...); #Value of regex : "/Hello\smy\name\sis\s(\w.*)/" $str =~ $regex;
Not one of the above returns a value for $1 Any ideas, the regex works fine on its own when used in a traditional method$str =~ /$regex/; #where omitting / in $regex eval($str =~ /$regex/); eval($str =~ $regex);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex from a string
by dragonchild (Archbishop) on Jun 17, 2005 at 14:56 UTC | |
by ghenry (Vicar) on Jun 17, 2005 at 14:57 UTC | |
by davidrw (Prior) on Jun 17, 2005 at 15:10 UTC | |
by ghenry (Vicar) on Jun 17, 2005 at 15:17 UTC | |
|
Re: Regex from a string
by TedPride (Priest) on Jun 17, 2005 at 15:38 UTC |