3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string1 = "sqrtpdrt"; // matched $string2 = "qwntfschrprtkjs"; // not matched (contains chr group) $regex = '/^(?i=.*[bcdfghjklmnpqrstvwxz]{4})(?!.*chr)/i'; var_dump(preg_match($regex, $string1)); var_dump(preg_match($regex, $string2));
Output for 4.4.9, 5.2.6 - 7.1.0
Warning: preg_match(): Compilation failed: unrecognized character after (? or (?- at offset 4 in /in/lF3uH on line 7 bool(false) Warning: preg_match(): Compilation failed: unrecognized character after (? or (?- at offset 4 in /in/lF3uH on line 8 bool(false)
Output for 4.3.11 - 4.4.8, 5.0.0 - 5.2.5
Warning: preg_match(): Compilation failed: unrecognized character after (? at offset 4 in /in/lF3uH on line 7 bool(false) Warning: preg_match(): Compilation failed: unrecognized character after (? at offset 4 in /in/lF3uH on line 8 bool(false)
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: unrecognized character after (? at offset 4 in /in/lF3uH on line 7 bool(false) Warning: Compilation failed: unrecognized character after (? at offset 4 in /in/lF3uH on line 8 bool(false)