Continue to use php regular expressions.

Source: Internet
Author: User
Tags php regular expression
Continue to obtain a php regular expression. when you copy an article online, the following content is often included in the article (xxx network & nbsp; www.xxx.com) (xxx network & nbsp; xxx.com) (xxx network & nbsp; www.xxx.cn) (xxx network & nbsp; www.xxx.net) [xxx network & nbsp; www. xxx. co continues to ask for a php regular expression. could you help me?
When copying articles online, the following content is often included in the articles:
(Www.xxx.com)
(Xxx network xxx.com)
(Www.xxx.cn)
(Www.xxx.net)
[Xxx www.xxx.com.cn]
[Xxx www.xxx.cn]
(Xxx network xxx.com)

The rule is that the website information is enclosed in Chinese () or [] or [], ", or English () [].
Most of the content is the URL

Find a regular expression that can be deleted and share it:
------ Solution --------------------
Try again, so it is better:
$ P = array (
"/(. +? \. (Com
------ Solution --------------------
Cn
------ Solution --------------------
Net ))/",
"/[. +? \. (Com
------ Solution --------------------
Cn
------ Solution --------------------
Net )]/",
"/[. +? \. (Com
------ Solution --------------------
Cn
------ Solution --------------------
Net) <)〗/",
"/". +? \. (Com
------ Solution --------------------
Cn
------ Solution --------------------
Net )』/",
"/". +? \. (Com
------ Solution --------------------
Cn
------ Solution --------------------
Net )」/",
"/\ [. +? \. (Com
------ Solution --------------------
Cn
------ Solution --------------------
Net) \]/",
"/\ (. +? \. (Com
------ Solution --------------------
Cn
------ Solution --------------------
Net )\)/"
);

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.