$TMP = "asdf"; $search = 'command'; $string = '`command -option $TMP`'; $string =~ /(`$search([^`]*)`)/ ; $match = $1; print "erkannter String: $match \n"; print (($string =~ m/($match)/ ) ?  "Regexp-Match: $1\n" : "kein Match\n");