Find a regular expression. thank you for choosing phpisshow from 2013-03-2915: 23: 27 at the end of this post. & lt; body & gt; & lt; a & nbsp; href = "/news/news-list.php? Id = 5 "& gt; title name & l returns a regular expression. thank you.
This post was last edited by phpisshow at 15:23:27
Title name
Href ="
/News/news-list.php? Id = 6 "> title name
Title name
Matches all the tags with href links on the page, and does not need href,
Need to propose three parameters, 1, title name this entire segment 2,/news/news-list.php? Id = 5 link address 3, title name
I used
Preg_match_all ('/] *?)> ([\ S \ S] *?) <\/A>/I'
However, if there is no href in the third method, the matching will continue. The entire A tag without href is matched, but this is not A greedy match.
Find a regular expression that can solve the problem. thank you!
------ Solution --------------------
$ S = <
Title name
Href ="
/News/news-list.php? Id = 6 "> title name
Title name
Html;
Preg_match_all ('/] + href = "(. +)" [^>] *> (. +) <\/a>/isU', $ s, $ m );
Print_r ($ m );