if ($string =~ m/\A(.*?)Ghz/s) { print "Everyting up to Ghz: $1\n"; }