How to match all

and all tags on the page using regular expressions?

WBOY
Release: 2023-03-02 14:48:01
Original
1784 people have browsed it

How to match all

and all tags on the page with regular expressions?

How to write this regular expression?

Reply content:

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>
Copy after login

/<p>[^<]*?</p>|<img [^]*?/>/giIf there is nesting, it cannot be processed.

/<p>.*</p>|<img.+>/gi

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template