Regular expressions are used to obtain the webpage source code keyword and description.

Source: Internet
Author: User
Obtain the webpage source code keyword and description in regular expressions. egg pain points: & lt; META & nbsp; NAME = "description" & nbsp; CONTENT = "Wall Street bond (bond.wswire.com) is the world's top bond website. It provides you with the fastest and most professional bond information in the global bond market and the round-the-clock bond financing, bond rating and quotation services. obtain the webpage source code keyword and description in regular expressions, egg hurts a little
Scenario 1:
 
  



Scenario 2:
 
  


Note: it may be case sensitive, and there is name, which is different from the content attribute [color = # FF6600]. [/color]

The younger brother tried to write it. he could only match one webpage and did not know what the problem was. Thank you!
Keyword:

 1.preg_match("/ tmpHtml,$inarr);
2.preg_match("/ tmpHtml,$inarr2);



1.preg_match("/ tmpHtml,$inarr);
2.preg_match("/ tmpHtml,$inarr2);
                


Note: Some webpages can match and some cannot.


------ Solution --------------------
Isn't there a get_meta_tags function?
------ Solution --------------------
Reference:
Isn't there a get_meta_tags function?

+ 1, you can return an array of meta, and then extract the required

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.