Handle returning '?' properly when finding the pattern