3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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"; } ?>
Output for 4.3.0 - 7.1.0
Age = 30 Month = January Day = 5