Regular expressions are related to Chinese characters. (if it is difficult for the teacher to work on projects, he will not be able to evaluate the scholarship. thank you)

Source: Internet
Author: User
Regular expression collection, which is a problem with Chinese characters. (if it is difficult for the teacher to do the project, he will not be able to evaluate the scholarship. thank you) $ str [& lt; strong & gt; chinese Medicine name & lt; strong & gt;] aiye & nbsp; aiye & lt; p & gt; as in the above code snippet, there are a total of 1265 strings. I have two questions: 1. I have collected aiye & nbsp; aiye. my code is as follows. why not? The content is empty. Preg_match)
$ Str = "【Chinese Medicine name] Aiye

";

As shown in the preceding code snippet, there are a total of 1265 strings.
I have two questions:
1. the Iye aiye is collected. my code is as follows. why not? The content is empty.
Preg_match ('/【Chinese Medicine name <\/strong>] (. *) <\/p>/iUs ', $ str, $ match1 );

2. I want to collect the aiye in English. I want to write code for others.
------ Solution --------------------
$ Str = "【Chinese Medicine name] Aiye

";
Preg_match ('/【Chinese Medicine name <\/strong>] (. *) <\/p>/iUs ', $ str, $ match1 );
Print_r ($ mattings );
Array
(
[0] => 【Chinese Medicine name] Aiye


[1] => aiye
)
Why not?
$ Str = "【Chinese Medicine name] Aiye

";
Preg_match ('/【Chinese Medicine name <\/strong>]. * (\ w +) <\/p>/iUs ', $ str, $ match1 );
Print_r ($ mattings );
Array
(
[0] => 【Chinese Medicine name] Aiye


[1] => aiye
)

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.