Re: [PBML] Re: Regular Expression Question: Is this syntax legal?
- From: Marcos Ramos <marcos.ramos@...>
> "/^$thing/"No. In this case Perl interpolates the variable into the regexp and
> Isn't that because you have $ (end line regex) just after ^ (line
> start reged) ?
> So it tries to match empty line followed by the word "thing".
uses the contents as part of the regexp. The thing is that if there
are any characters special for regexps they are treated specially. So
if $thing contains '[test]', then the regexp checked will be
/^[test]/. Which means ... find one of the characters "t", "e" or "s"
at the beginning of the matched string.
===== Jenda@... === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery