3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "I will turn 30\non January 5"; $regex = '/(\d+).*?on ([^ ]+) (\d+)/s'; if (preg_match($regex, $str, $matches)) { echo 'Age = ' . $matches[1] . "\n"; echo 'Month = ' . $matches[2] . "\n"; echo 'Day = ' . $matches[3] . "\n"; } ?>

preferences:
49.1 ms | 402 KiB | 5 Q