3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '<div><a href=%http://link1%><img></a><a href=%http://link2%><img></a><a href=%http://link3%><img></a></div>'; $re = '|<div>((<a((?!href)(?!<).)+?href=%([^%]+?)%((?!</a>).)+?</a>){3}}</div>|'; $matches = array(); echo('result='.intval(preg_match($re, $string, $matches))."\n"); echo('$matches='); print_r($matches);
based on XATlh
Output for 4.3.11 - 7.2.0
Warning: preg_match(): Compilation failed: missing ) at offset 70 in /in/t9AsH on line 7 result=0 $matches=Array ( )
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: missing ) at offset 70 in /in/t9AsH on line 7 result=0 $matches=Array ( )