3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $postcode = 'SW196QX'; // Validate the postcode if (preg_match('/^GIR 0AA)|((([A-Z-[QVX]][0-9][0-9]?)|(([A-Z-[QVX]][A-Z-[IJZ]][0-9][0-9]?)|(([A-Z-[QVX]][0-9][A-HJKPSTUW])|([A-Z-[QVX]][A-Z-[IJZ]][0-9][ABEHMNPRVWXY])))) [0-9][A-Z-[CIKMOV]]{2})$/', $postcode) === 1) { echo 'Invalid'; } else { echo 'Valid'; }
based on 3pvJ2
Output for 5.3.18 - 7.2.0
Warning: preg_match(): Compilation failed: unmatched parentheses at offset 8 in /in/RBtJ1 on line 6 Valid