Collect regular expressions

Source: Internet
Author: User
Collect regular expressions
                                                                            New product area                                                            
  • Warm top

    • Fake two (shirt collar)
    • V-neck women's clothing


  • The above is the level-1 category that I matched
    $ Dafht = '# (. *) # iUs ';
    Preg_match_all ($ dafht, $ fenlei, $ dafenlei );

    But it is invalid.


    A level-1 classification is mainly used to collect the numerical ID of the category-907362761.htm and the following name

    Level 2 collection category-907362761.htm parentCatId = 907362759 the two digit IDs and the names

    How can I write a card for a long time?








    Reply to discussion (solution)

    Level 1 :/.*? <\/H4>/isU, not tested. I don't know if it can match

    Level 2 classification is not clear

    Why bother writing this? If the website is slightly changed, the effort will be wasted.
    There are many simple and practical tools on the internet. why not?
    For example

    $ S = <TXTNew product area                                                            
  • Warm top

    • Fake two (shirt collar)
    • V-neck women's clothing
    • TXT; include 'simple _ html_dom.php '; $ p = new simple_html_dom; $ p-> load ($ s); foreach ($ p-> find ('A ') as $ v) {echo $ v-> class, PHP_EOL; // This is the class echo $ v-> href, PHP_EOL that can be distinguished; // This is url echo trim ($ v-> innertext (), PHP_EOL; // This is the description text}
  • Cat-name fst-cat-name http://bosidengny.tmall.com/category-907362758.htm? Search = y & catName = % D0 % C2 % C6 % B7 % D7 % A8 % C7 % F8 cat-name fst-cat-namehttp: // bosidengny.tmall.com/category-907362759.htm? Search = y & catName = % B1 % A3 % C5 % AF % C9 % CF % D7 % B0 warm Top cat-name snd-cat-namehttp: // bosidengny.tmall.com/category-907362760.htm? Search = y & parentCatId = 907362759 & parentCatName = % B1 % A3 % C5 % AF % C9 % CF % D7 % B0 & catName = % BC % D9 % C1 % BD % BC % FE % A3 % A8 % B3 % C4 % C9 % C0 % C1 % EC % A3 % A9 fake two (shirt collar) cat-name snd-cat-namehttp: // bosidengny.tmall.com/category-907362761.htm? Search = y & parentCatId = 907362759 & parentCatName = % B1 % A3 % C5 % AF % C9 % CF % D7 % B0 & catName = V % C1 % EC % C9 % CF % D7 % B0V collar

    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.