Home > Article > Backend Development > How to match all
and all tags on the page using regular expressions?
How to match all
and all tags on the page with regular expressions?How to write this regular expression?
How to match all
and all tags on the page with regular expressions?How to write this regular expression?
<code>/<p(\s[^>]*)?>.*?</p>|<img\s[^>]+>/gis</code>
/<p>[^<]*?</p>|<img [^]*?/>/gi
If there is nesting, it cannot be processed.
/<p>.*</p>|<img.+>/gi