3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(preg_match("/(?=[a-z]*[0-9])(?=[0-9]*[a-z])([a-z0-9-]+)/i", 'aaa', $match)) { echo $match[1] . "\n\r"; } if(preg_match("/(?=[a-z]*[0-9])(?=[0-9]*[a-z])([a-z0-9-]+)/i", '0000', $match)) { echo $match[1] . "\n\r"; } if(preg_match("/(?=[a-z]*[0-9])(?=[0-9]*[a-z])([a-z0-9-]+)/i", 'aaa1111', $match)) { echo $match[1] . "\n\r"; } if(preg_match("/(?=[a-z]*[0-9])(?=[0-9]*[a-z])([a-z0-9-]+)/i", 'aaa1111 ', $match)) { echo $match[1] . "\n\r"; }
based on R1te4
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
aaa1111 aaa1111