3v4l.org

run code in 300+ PHP versions simultaneously
<?php $matches=array(); $string = 'This is a [templateVar]'; preg_match_all("/\[[a-z]*\]/", $string, $matches); var_dump($matches);

preferences:
31.8 ms | 402 KiB | 5 Q