note
thanos1983
<p>Hello [id://1051682|PetreAdi],</p>
<p>Something like that?</p>
<code>
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @array = ("aaa111bbb", "ab01ac d ab02ac ab03ac", "aaa222bbb", "ab04acab05ac r ab06ac", "aaa333bbb", "ab01ac t cab06acab10ac");
foreach my $str (@array) {
my @all_nums = $str =~ /(\d+)/g;
print Dumper \@all_nums;
}
__END__
$ perl test.pl
$VAR1 = [
'111'
];
$VAR1 = [
'01',
'02',
'03'
];
$VAR1 = [
'222'
];
$VAR1 = [
'04',
'05',
'06'
];
$VAR1 = [
'333'
];
$VAR1 = [
'01',
'06',
'10'
];
</code>
<p>On the Monastery it has been answered before this question ([id://748471|extracting number from string]).</p>
<code></code>
<div class="pmsig"><div class="pmsig-1069339">
Seeking for Perl wisdom...on the process of learning...not there...yet!
</div></div>
11108250
11108250