Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: find all numeric values from a string and join them

by james28909 (Deacon)
on May 19, 2018 at 16:37 UTC ( #1214921=note: print w/replies, xml ) Need Help??


in reply to find all numeric values from a string and join them

use strict; use warnings; while(<DATA>){ print "$1|$2" if (/EEH_ErrorCode\=\( (\d+), \/\* Component \*\/ (\ +d+) \/\* Error \*\//); } __DATA__ EEH_ErrorCode=( 15, /* Component */ 65 /* Error */
OR...
use strict; use warnings; my @array; while( read( DATA, my $buf, 1 ) != 0 ){ push @array, $buf if $buf =~ /\d/; } print @array; __DATA__ a1b2c3d4

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-03-31 03:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (179 votes). Check out past polls.

    Notices?