結果 : check if a string matches a pattern in python