fork download
  1. <?php
  2.  
  3. $re = "/^\\$[^|{}]*$/m";
  4. $str = "\$article.author\n{\$article.timestamp}";
  5.  
  6. preg_match_all($re, $str, $matches);
  7. print_r($matches);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => $article.author
        )

)