How can I write a regular expression? how can I write a regular expression?
Http://www.nhdali.com/zsxx/news02.php want to match here 'Investment and economic dynamic column' written for a long time can not be written, almost between ''and'' content.
------ Solution --------------------
There are still pages.
------ Solution --------------------
No one has returned to you yet? It seems that I am idle.
/(? :) ([\ S \ S] + )(? :)/IU
------ Solution --------------------
$ Con = file_get_contents ("http://www.nhdali.com/zsxx/news02.php? Page = ". $ _ GET [id]);
$ Preg = "# (. *) # iUs ";
Preg_match_all ($ preg, $ con, $ arr );
------ Solution --------------------
PHP code
$ Str = file_get_contents ("http://www.nhdali.com/zsxx/news02.php"); $ match = "/] *?> (.*?) <.*? Em> (.*?) <\/Em> .*?([^ <] *?)------ Solution --------------------
It is estimated that this content will be matched, and the title, content, and url resolution of each specific information will be required!
Using dom + xpath is much better than analyzing it once and then again!
In addition, we recommend that you use regular expressions on the fourth floor to find all the content you want!
------ Solution --------------------
Discussion
I would like to ask what the last iUs of regular expressions means on the third and fourth floors. I is case-insensitive. I don't know anything else!
------ Solution --------------------
Discussion
Reference:
I would like to ask what the last iUs of regular expressions means on the third and fourth floors. I is case-insensitive. I don't know anything else!
U is encoded according to unicode, and s is. can represent any blank character
------ Solution --------------------
$ Str_pre = '/\ s *(.*?) <\/A> (.*?) \ S *(.*?) <\/Em> \ s * <\/span> \ s *([\ W \ W] *?) | (.*?)) <\/Small> /';
This can be used to match!