Thread RE recursion
(24 answers)
Opened by linuxCowboy at 2014-04-15 20:19
Recursion:
s!<(\w+)[^>]*>([^<]*|(?R))*</\1>!!g; entspricht: s!<(\w+)[^>]*>[^<]*</\1>!!g while /<\w+[^>]*>/; Code: (dl
)
1 S='<div > <div > </div><div > not_show_1 </div> </div> show_1 <div > <a > not_show_2 <i /> </a> <s> </s> </div> show_2' Nur zuerst die self-closing tags entfernen und eine backreference verwenden! :-) We choose to go to the moon not because it is easy, but because it is hard! |