Questions about PHP regular expression matching

Source: Internet
Author: User
Questions about PHP regular expression matching... tutorial! [Q] Thanks for your selfless help. thank you! (& nbsp ;) [A] thank you [B] thank you very much [C] thank you very much [D] thank you very much [E] 100,000 thank you [F] [K] D How to use the above strings regular expressions remove [Q], [A], [B], [C], [D], [E], [F], and [K, combine the remaining strings into an array to learn more about PHP regular expression matching... ask for advice!
[Q] Thank you for your selfless help. thank you () [A] thank you [B] thank you very much [C] thank you very much [D] thank you very much [E] 100,000 thank you [F] million thank you [K] D

How to remove [Q], [A], [B], [C], [D], [E], [F], and [K] from the above strings using regular expressions?, combine the remaining strings into an array!
------ Solution --------------------
$ S = '$ Q] Thank you for your selfless help. thank you () [A] thank you [B] thank you very much [C] thank you very much [D] thank you very much [E] 100,000 thanks to [F] [K] d ';
$ Ar = preg_split ('/\ [A-Z] \]/', $ s );

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.