Web content has recently been crawled, but regular expressions are not familiar and difficult to write.
Now we need to match this.
Label
Which great God can give a regular expression, when practicing practiced hand ha, grateful!
Reply content:
Web content has recently been crawled, but regular expressions are not familiar and difficult to write.
Now we need to match this.
Label
Which great God can give a regular expression, when practicing practiced hand ha, grateful!
Although I am not phper, but also through a variety of ways to do HTML parsing.
We can use regular, DOM, Xpath, CSS query to solve the problem of the main question.
The regular will change with more difficult to understand,
Although the DOM is more readable, it is cumbersome,
XPath brings up the problem with HTML clean,
I strongly recommend it in a css query
way.
The main problem is to try the class library:
http://simplehtmldom.sourceforge.net/
https://code.google.com/p/phpquery/
http://txt2re.com solve your headache problem ... RegExp Generator (I won't use it anyway)
Wrote a
$regexp=/.*
/g;
I did not test under PHP ... And the temporary writing is also more bloated