結果 : check if string follows pattern python