PracticeDev/study_perl/re/14re.pl

10 lines
227 B
Perl
Raw Normal View History

2022-12-20 17:31:11 +08:00
#!/usr/bin/perl
$txt="ab\ncd";
$txt =~ /a.*c/m; # 匹配失败
print "===match start===\n$&\n===match end===\n";
$txt="ab\ncd";
$txt =~ /a.*c/ms; # 匹配成功
print "===match start===\n$&\n===match end===\n";