开发者

PHP Regex XML to allow attributes

/<peanut\:compressedContent>(.*?)<\/peanut\:compressedContent>/si

currently support no attributes but i also want to cap开发者_开发知识库ture the stuff even if it has attributes.


http://www.regular-expressions.info/examples.html#~HTML

You can use [^>]* to match/ignore anything within tags. Likewise you might want to use [^<>]* instead of .*? for ensuring it only matches text content:

/<peanut:compressedContent[^>]*>([^<>]*)<\/peanut:compressedContent>/si
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜