use strict; use warnings; use 5.012; my $string = '79899920179'; my @results; my $number; while ($string =~ /(\d)/g) { $number .= $1; next if $number < 32; push @results, $number; $number = ""; } say for @results; --output:-- 79 89 99 201 79
In reply to Re: how to split the string into two or three numbers based on certain value.
by 7stud
in thread how to split the string into two or three numbers based on certain value.
by venky4289
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |