Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: how to split the string into two or three numbers based on certain value.

by 7stud (Deacon)
on Feb 12, 2013 at 19:18 UTC ( #1018431=note: print w/ replies, xml ) Need Help??


in reply to how to split the string into two or three numbers based on certain value.

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


Comment on Re: how to split the string into two or three numbers based on certain value.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018431]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-11-26 11:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (168 votes), past polls