# i modifer to make it case insensitive, just in case. if ($line =~ /Analysis Date Range\s*:\s*([0-9]+)\/([0-9]+)\/([0-9])+/i) { print "I found an Analysis date with month/day $1, $2 in year $3\n"; }else{ print "This line did not have an analysis date that I recognize in it\n"; }