To shed some light, tip #4 from the Basic debugging checklist (Data::Dumper):
use warnings; use strict; use Data::Dumper; "<div></div>" =~ /(?<start>.*?)((?!\< *\/[\w\d\-]+\>).)*/; print Dumper(\%+); __END__ $VAR1 = { 'start' => '' };
Tip #9: YAPE::Regex::Explain
---------------------------------------------------------------------- .*? any character except \n (0 or more times (matching the least amount possible)) ----------------------------------------------------------------------
Your regex is telling it that nothing is a valid match. Have you considered using an HTML parser module from CPAN?
In reply to Re: regex catch pattern that doesn't contain a pattern
by toolic
in thread regex catch pattern that doesn't contain a pattern
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |