PracticeDev/study_perl/re/11re.pl

10 lines
188 B
Perl
Raw Permalink Normal View History

2022-12-20 17:31:11 +08:00
#!/usr/bin/perl
$txt="1234ab56";
while($txt =~ m/\G\d\d/g){ # 不使用c修饰符
print "matched: $&, ",pos $txt,"\n";
}
$txt =~ m/\G\d\d/gc;
print "matched: $&, ",pos $txt,"\n";