3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = '<td valign="top" width="300"class="topborder"><ahref="/path/to/somewhere" class="bigger">random1</a><br/> <td valign="top" width="300"class="topborder"><ahref="/path/to/somewhere2" class="bigger">random2</a><br/>'; $pattern = '/width=\"300\"class=\"topborder\"><ahref=\"(.*?)"/'; print "<pre>"; if (preg_match_all($pattern, $str, $match)) print_r($match); else print "nope";
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>Array ( [0] => Array ( [0] => width="300"class="topborder"><ahref="/path/to/somewhere" [1] => width="300"class="topborder"><ahref="/path/to/somewhere2" ) [1] => Array ( [0] => /path/to/somewhere [1] => /path/to/somewhere2 ) )