3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //with ^ $str = " {user:fname} and the last name = {user:lname}"; preg_match_all("/^\{(\w):(\w)\}/", $str, $matches); print_r($matches); //without ^ preg_match_all("/\{(\w):(\w)\}/", $str, $matches2); print_r($matches2);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) ) Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) )