while ( $string =~ m!(]*>)(.+?]*>)!ig ) { print "$1 \n"; print "$2 \n"; }