Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

python 正则匹配问题

str等于"<p>名称:Mega Bomberman<br/>名称:Mega炸弹人<br/></p>"或等于"<p>名称:Mega炸弹人<br/>名称:Mega Bomberman<br/></p>"

我想匹配到str里的“Mega炸弹人”这几个字。有好的办法吗。我用的python


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你这... 就是想匹配 名称 和最近的 <br/> 中间包含了中文字符的一段文字啊. 这样其实不具备通用性,因为这个名词可能就没有中文,如果没有中文了,就无法和另一个区分开了..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...