in reply to find all numeric values from a string and join them
OR...use strict; use warnings; while(<DATA>){ print "$1|$2" if (/EEH_ErrorCode\=\( (\d+), \/\* Component \*\/ (\ +d+) \/\* Error \*\//); } __DATA__ EEH_ErrorCode=( 15, /* Component */ 65 /* Error */
use strict; use warnings; my @array; while( read( DATA, my $buf, 1 ) != 0 ){ push @array, $buf if $buf =~ /\d/; } print @array; __DATA__ a1b2c3d4
|
|---|