fork download
  1. <?php
  2.  
  3. $re = '~(?:\[[^][]*]){2,}~';
  4. $str = "[one][two][three]";
  5. preg_match($re, $str, $matches);
  6. print_r($matches[0]);
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
[one][two][three]