Problems? Is your data what you think it is? | |
PerlMonks |
Re: Regular Expression problem when Extracting Start\ VALUE \Endby japhy (Canon) |
on Sep 30, 2005 at 14:35 UTC ( [id://496432]=note: print w/replies, xml ) | Need Help?? |
Backslashes are a pain in the back. Slash. The problem is that your regex ends up being /TRicky\(.*?)\endTricky/ because your variables interpolate. When that gets compiled as a regex, it's a problem because the trailing backslash of "TRicky\" has escaped the opening parenthesis. I would suggest using my $StartTag = qr/TRicky\\/; my $EndTag = qr/\\endTricky/; The qr// operator will keep things properly backslashed later, because the content is treated like a regex.
In Section
Seekers of Perl Wisdom
|
|