fork download
  1. <?php
  2.  
  3. $str = "This is a {cat} with {big} eyes.";
  4.  
  5. preg_match_all("/\{[^}]+\}/", $str, $matches);
  6.  
  7. var_dump($matches);
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
array(1) {
  [0]=>
  array(2) {
    [0]=>
    string(5) "{cat}"
    [1]=>
    string(5) "{big}"
  }
}