开发者

PHP Regex XML to allow attributes

开发者 https://www.devze.com 2023-02-15 01:30 出处:网络
/<peanut\\:compressedContent>(.*?)<\\/peanut\\:compressedContent>/si currently support no attributes but i also want to cap开发者_开发知识库ture the stuff even if it has attributes.http:
/<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

精彩评论

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