$mystring = "Rescue21_binaries_V5.0.29.0_patch_R5.0.24.1_DiffList.txt"; if( $mystring =~ m/Rescue21.*_patch_.*DiffList.txt/ ) { print "Matched\n"; }