3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $regexp = '/^V[ABC][1-5][0-9]?$/'; $tests = array( 'VA1','VA54','VB26','VC26', 'V25','VA66','VD26','VAA24','22', ); foreach($tests as $t) { var_dump("$t -> ".preg_match($regexp, $t)); }
Output for 4.3.0 - 7.1.0
string(8) "VA1 -> 1" string(9) "VA54 -> 1" string(9) "VB26 -> 1" string(9) "VC26 -> 1" string(8) "V25 -> 0" string(9) "VA66 -> 0" string(9) "VD26 -> 0" string(10) "VAA24 -> 0" string(7) "22 -> 0"