如何提取一行中的多个重复信息?

如何提取一行中的多个重复信息?

比如:$str = "aowfjiAAA:1 wjifiodAAA:2fiowe AAA:3";
怎么把这里的1,2,3拎出来,保存到一个array里面?



[Copy to clipboard] [ - ]
CODE:
$str = "aowfjiAAA:1 wjifiodAAA:2fiowe AAA:3";
@num = $str =~/:(\d+)/g;
print "@num\n";



QUOTE:
原帖由 ynchnluiti 于 2008-10-31 13:55 发表

$str = "aowfjiAAA:1 wjifiodAAA:2fiowe AAA:3";
@num = $str =~/\d+)/g;
print "@num\n";

多谢,原来还可以这么用。。。~