- or download this
my @matches = '1 foo 22 bar 3' =~ /\d+/g;
print "@matches";
- or download this
1 22 3
- or download this
while (my $match = '1 foo 22 bar 3' =~ /(\d+)/g) {
print "$1 ";
}
- or download this
my @matches = '1 foo 22 bar 3' =~ /^\d+/g;
print "@matches";