3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'ananas'; $re = "^an|^ananas"; ereg($re, $str, $m); echo "$re\n", print_r($m, true), "\n"; $re = "^an.|^an(.)"; ereg($re, $str, $m); echo "$re\n", print_r($m, true), "\n"; $re = "^an(.)|^an."; ereg($re, $str, $m); echo "$re\n", print_r($m, true);

preferences:
53.42 ms | 402 KiB | 5 Q