-2
次の部分文字列の開始と終了を特定の記号で取得したい。今私は最初の出来事があります。コード:Pythonで部分文字列の次の出現を見つける
start = 'version='
end = '>'
s = 'text text i version="7.0"> text text version="9.0.1"> text text'
result = s[s.find(start)+len(start):s.find(end)].strip()
print result
結果は次のとおりです。 "7.0"
私はre
モジュールから "9.0.1"