Php regular expressions cannot contain certain characters.
Source: Internet
Author: User
Php regular expressions cannot contain certain characters, such as my original regular: & lt; ignore_js_op & gt; [\ s \ S] *? The problem is that another character including & lt; ignore_js_op & gt; is obtained in the middle. How to write the string ignore_js_op that is no longer included? Php regular expressions cannot contain certain characters.
For example, my original regular expression:
[\ S \ S] *?
The problem is that another section contains . How to write the string ignore_js_op that is no longer included?
------ Solution --------------------
Use preg_replace_callback () to first match and then replace it with
------ Solution --------------------
Do not use regular expressions instead of dom for parsing.
Http://php.net/manual/en/book.dom.php
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service