3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test = array('ahoj', 'blb', 'bla', 'blabla', '1_22x44','1_22x44a', 'a1_22x44'); $pattern = '/^(?![0-9]_[0-9]*x[0-9]*$).+$/'; foreach ($test as $t) { echo $t.' : '.(preg_match($pattern, $t)?'yes':'no') ."\n\r"; }
Output for 4.3.0 - 7.1.0
ahoj : yes blb : yes bla : yes blabla : yes 1_22x44 : no 1_22x44a : yes a1_22x44 : yes