使用正则匹配文档中的XML块,在文档中有多个<example></example><example></example>,则需要匹配最近的结束标签</example>。
在工作中我使用了如下正则来实现这个功能,<example>[^@]*?</example>,实现了我需要的效果,但是对于xml结构的匹配还是很弱,继续研究。正则这水很深。。。
使用正则匹配文档中的XML块,在文档中有多个<example></example><example></example>,则需要匹配最近的结束标签</example>。
在工作中我使用了如下正则来实现这个功能,<example>[^@]*?</example>,实现了我需要的效果,但是对于xml结构的匹配还是很弱,继续研究。正则这水很深。。。
Using Gravatars in the comments - get your own and be recognized!
XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>