$string = "Viood_ram_shiva_RVCT22"; if ($string =~/(.*?)\"_RVCT"/) { print "The file name is $1. "; }