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.
)