The above content is obtained by begging for regular expression matching, and there is no result in the study for a long time.

Source: Internet
Author: User
The following content is obtained by begging for regular expression matching, and there is no result in the study for a long time. The html code is as follows: & lt; div & nbsp; class = "brandItem-info" & gt; & nbsp; & lt; div & nbsp; class = "bIi-brand & nbsp; j begged for regular expression matching to find the following content, and there was no result for a long time.
The html code is as follows:




Eva Ouxiu/Ihua o



Brand description:

Street, commuting, women's wear;


Total monthly sales: 5702 pieces


Representatives of fashion business lifestyle, suitable for handsome, elegant, and sexy urban women dressed in conference negotiations, casual parties, banquet parties.




Follow this brand




PHP regular expressions are required to match the content starting from the beginning to the end.
Thank you.
------ Best solution --------------------

preg_match('/(.*)<\/div>/is',$str,$mat);
print_r($mat[1]);

Ah?
------ Other solutions --------------------
Reference:
PHP code

Preg_match ('/(. *) <\/div>/is', $ str, $ mat );
Print_r ($ mat [1]);


Ah?

I can't try it because I forgot to tell you that the above code is in html and there is a lot of content later. Http://brand.tmall.com/categoryIndex.htm? IndustryId = 110 & categoryId = 50031407 & etgId = 91 & page = 1 get the brand in this address. Information
------ Other solutions --------------------
Reference:
Reference:

PHP code

Preg_match ('/(. *) <\/div>/is', $ str, $ mat );
Print_r ($ mat [1]);


Ah?

I can't try it because I forgot to tell you that the above code is in html and there is a lot of content later. Http://brand.tmall.com/categoryindex.htm .......


Regular answer:
Preg_match_all ('/(.*?) <\/Div>/ism ', $ content1, $ mat );
Print_r ($ mat );

Thanks to franzhong

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.