How can I split the different links.
<ul>
<li><a href="/page/?link1=2&page=2#fff">pag2 </a></li><li><a href="/page/">pag2 </a></li><li><a href="/page/">pag2 </a></li>
</ul>
I try something like that, but it didn't find it at all
$re = '/<a href=["\'](([^\'\"\#]*)?)(?=[\'"\#])(.*)["\']>[^<\/a>]+<\/a>/mi';
$str = '<ul>
<li><a href="/page/">pag2 </a></li><li><a href="/page/">pag2 </a></li><li><a href="/page/">pag2 </a></li>
</ul>
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Also try this, but it capture it all
$re = '/<a href=["\'](([^\'\"\#]*)?)(?=[\'"\#])(.*)["\']>.+<\/a>/mi';