Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by james28909 (Deacon)
on May 19, 2018 at 16:37 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1214921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found