k = 'a bunch of data and then name ""Serpin-ps""'
print re.search(r'name\s""(\w+)""',k).group(1)
与えます:
AttributeError: 'NoneType' object has no attribute 'group'
望ましい出力 ='Serpin-ps'
テキストに「-」があるため、意味があります。
他のすべての英数字と一緒に「-」を組み込む正規表現を取得する方法はありますか?