fork download
  1. <?php
  2.  
  3. $regex = '/^\-1\.2964505(\?pagereq=(\d+))?$/Ui';
  4. preg_match($regex, '-1.2964505?pagereq=1', $matches);
  5. var_dump($matches);
  6. preg_match($regex, '-1.2964505', $matches);
  7. var_dump($matches);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
array(3) {
  [0]=>
  string(20) "-1.2964505?pagereq=1"
  [1]=>
  string(10) "?pagereq=1"
  [2]=>
  string(1) "1"
}
array(1) {
  [0]=>
  string(10) "-1.2964505"
}