$c = substr($_,2,1); $pat = "\[^$c\]{2}$c\[^$c\]{2}$c\[^$c\]{2}"; print "yup" if /$pat/