Got a text file that looks like:
200.0 250.0 300.0 350.0 400.0
162:02:10 017:01:56 017:08:18 011:16:22 008:40:18
580.0 600.0 620.0 640.0 660.0
004:04:01 001:47:27 007:25:29 017:44:53 003:07:34
Trying to parse out lines 1 & 3 as "values", and lines 2 & 4 as "times".
My code:
if($line =~ /^\d[^:]*\d/){
my @values = split(/\s/,$line);
}
elsif($line =~/^\d+:\d+:\d+/){
my @time = split(/\s/,$line);
}
Problem: Always matches first regex. My understanding of regex #1 is it will match a line that starts with a digit, followed by any value that is not a ':' any number of times, followed by another digit.