<?php $regex = '/^\-1\.2964505(\?pagereq=(\d+))?$/Ui';preg_match($regex, '-1.2964505?pagereq=1', $matches);var_dump($matches);preg_match($regex, '-1.2964505', $matches);var_dump($matches);
Standard input is empty
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" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!