10 lines
188 B
Perl
10 lines
188 B
Perl
|
#!/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";
|