Help for this page
$content = "<head><body blah></body><foo></foo></head>"; $content =~ m[^(<(.+?)>.*?</\2>)$]; print $1."\n";
$content = "<head><body blah></body><foo></foo></head>"; while ($content =~ m[(<.+?>)]g) { print $1."\n"; }