my $re = qr(\d{1,2}\.\.\d{1,2}); # $re = qr(\d+\.\.\d+) # is more general, and probably better # unless you want to be able to detect # deviations from the pattern you posted; # likewise, the space used in the full # regexp below may be needlessly specific; # you may want to change it to \s+ to allow # for variable-length whitespace between # the parts. $line =~ /^((?:$re )+$re)/; my $captured = $1; my @parts = split ' ', $captured;