fork(1) download
  1. <?php
  2.  
  3. // your code goes herenew String(new char[n]).matches(".?|(..+?)\\1+")
  4.  
  5.  
  6. $str = str_repeat('.', 7);
  7.  
  8.  
  9. $pattern = '/.?|(..+?)\\1+/';
  10.  
  11. if (!preg_match($pattern, $str, $matches)) {
  12. echo 'matching', "\r\n";
  13. }
  14.  
  15. var_dump($matches);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
array(1) {
  [0]=>
  string(1) "."
}