3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $regex = "/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/"; $string = "192.168.0.1"; if (preg_match($regex, $string)){ echo 'hello'; } else { echo 'world'; }
based on Z9aQO
Output for 4.3.0 - 7.2.0
hello