3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sms = 'bb [url=http://youtube.com|id=67] kghkj [url=http://foo.com]'; preg_match_all('|\[url=(.*)\|id=(.*)\]|U',$sms, $arr); var_dump($arr);
based on IK046
Output for 4.3.0 - 7.2.0
array(3) { [0]=> array(1) { [0]=> string(30) "[url=http://youtube.com|id=67]" } [1]=> array(1) { [0]=> string(18) "http://youtube.com" } [2]=> array(1) { [0]=> string(2) "67" } }