私はUbuntuのコマンドラインでのpythonを使用していますし、これは私のコードです:関数でre.searchを使用するにはどうすればよいですか?
import re
from sys import stdin
def find(pat,text):
m= re.match(pat,text)
if m:
print m.groups()
else:
print m.groups()
pat=stdin.readline()
text=stdin.readline()
answer= find(pat,text)
thatsのすべて...私が取得エラーは次のとおりです。
AttributeError: 'NoneType' object has no attribute 'groups'
をあなたのエラーが表示されます「なし」? –