Re: [PBML] Re: Regex - repeating a pattern within two anchors?
>>>>> "hooyar66" == hooyar66 <pcbcad@...> writes:This is dangerous:
hooyar66> $line =~ /\"(.+)\"/;
because if it *doesn't* match, then:
hooyar66> my $str = $1;
the $1 there is the *previous* $1. Bad. Very bad idea.
NEVER use $1 except in a context where you have validated that the
match has actually succeeded.
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!