スペースで区切られた 3 つの単語の正規表現が必要です。私はこれを試しました:
>>>match = re.search('\w\s\w\s\w', 'cat dog mouse')
>>>match.group()
....
AttributeError: 'NoneType' object has no attribute 'group'
\w\s\w\s\w
「単語単語単語」を受け入れるべきではありませんか?
スペースで区切られた 3 つの単語の正規表現が必要です。私はこれを試しました:
>>>match = re.search('\w\s\w\s\w', 'cat dog mouse')
>>>match.group()
....
AttributeError: 'NoneType' object has no attribute 'group'
\w\s\w\s\w
「単語単語単語」を受け入れるべきではありませんか?