\n表示向后引用
use strict; use warnings; my $str = "<title> hello world </title>"; if($str =~ /(?#start of a tag)<([^>]+)>(.*?)(?#end od a tag)<\/(\1)>/){ print "$1\n"; print "$2\n"; print "$3\n"; }
\n表示向后引用
use strict; use warnings; my $str = "<title> hello world </title>"; if($str =~ /(?#start of a tag)<([^>]+)>(.*?)(?#end od a tag)<\/(\1)>/){ print "$1\n"; print "$2\n"; print "$3\n"; }