I have a CSV file where each row looks something like this:
509,,SOME VALUE,0,1,1,0.23
I am attempting to find all numbers that are two or more digits that may or may not be followed or preceded by a comma and then put them in an array by using this Perl code:
my $file ='somefile.csv';
open my $DATA , "<", $file;
$_ = do {local $/; <$DATA>};
my @A = /,?(\d{2,}),?/g;
close $DATA;
As expected it is matching the first comma separated value in the row above but
also it is matching the 23
portion of the last value, 0.23
. I would expect this not to match because of the .
.
Could someone help me with making my regex more specific so it will not find the numbers before or after the period too?