<?php $re = '/\{\$([^.{}]+(?:\.[^.{}]+)+)\}/'; $str = "Welcome {\$user.first_name} to the {\$site} version 1.5. Your username is {\$user.username}. Your reputation at present is {\$user.reputation.name}"; preg_match_all($re, $str, $matches);print_r($matches[1]);
Standard input is empty
Array ( [0] => user.first_name [1] => user.username [2] => user.reputation.name )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!