P is for Practical | |
PerlMonks |
Re: Regex Start Anchor with variablesby Samy_rio (Vicar) |
on Oct 05, 2006 at 05:52 UTC ( [id://576472]=note: print w/replies, xml ) | Need Help?? |
Hi chrism01, use Quotemeta "\Q & \E".
Updated See the documentation in perldoc as quotemeta In string2 $str2 = ".1.2.3.4";, dots(.) are present and it will be treated as any character except new line in regular expression. So dots should be escaped using "\Q". Regards, eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';
In Section
Seekers of Perl Wisdom
|
|