fork(1) download
  1. <?php
  2.  
  3. $re = '/\{\$([^.{}]+(?:\.[^.{}]+)+)\}/';
  4. $str = "Welcome {\$user.first_name} to the {\$site} version 1.5. Your username is {\$user.username}. Your reputation at present is {\$user.reputation.name}";
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches[1]);
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
Array
(
    [0] => user.first_name
    [1] => user.username
    [2] => user.reputation.name
)