The dot metacharacter and the zero or more quantifier
while(<DATA>){ print if s/[A-Z].*y/Tom/; } __DATA__ Mary 101 Tom 201