python 从字符串中提取指定的内容?

<meta name="keywords" content="hello word12131你好"/>
如上字符串中,content的值,每次都是不一样的(值包括中文,数字,英文,空格等),我想只提取content中的内容,请问该如何操作?

s = '<meta name="keywords" content="hello word12131你好"/>'
import re
c = re.search('content="(.*)"', s).group(1)
温馨提示:答案为网友推荐,仅供参考
相似回答