How to extract numbers from webpages

Source: Internet
Author: User
How do I extract numbers from a webpage? At the end of this post, the following string is edited by chzbv1984 from 2013-04-2517: 03: 46. this string is a part of the page. & lt; span & nbsp; & gt; season: & lt; a & nbsp; hrefmovie. douban. how does comsubject3401355reviews & gt extract numbers from webpages?

This post was last edited by chzbv1984 at 17:03:46

The following string is a part of the web page, quarter: More comments (109 in total)
Dfs
Total
109
Entries
How to use a regular expression to extract 109 three numbers, $ p_search = '/(. *) (\ S *) | (\ d + ). * <\/a>/'; what is the error?


------ Solution --------------------
$ S = 'quarter: More comments (109 in total)
Dfs
Total
109
Entries
All 109 entries ';
$ P_search = '# (\ d + )()? \ S * # s ';
Preg_match_all ($ p_search, $ s, $ m );
Print_r ($ m [1]);

Array
(
[0] = & gt; 109
[1] => 109.
[2] => 109.
)

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.