3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $regex = '@^/cef/?((?!/logs/).)*)$@'; var_dump(preg_match($regex, '/cef/foo/bar/baz', $matches), $matches); var_dump(preg_match($regex, '/cef/foo/logs/access.log', $matches), $matches);
Output for 5.2.0 - 7.1.0
Warning: preg_match(): Compilation failed: unmatched parentheses at offset 21 in /in/mH8jQ on line 5 bool(false) NULL Warning: preg_match(): Compilation failed: unmatched parentheses at offset 21 in /in/mH8jQ on line 6 bool(false) NULL
Output for 4.3.11 - 5.1.6
Warning: preg_match(): Compilation failed: unmatched parentheses at offset 21 in /in/mH8jQ on line 5 bool(false) array(0) { } Warning: preg_match(): Compilation failed: unmatched parentheses at offset 21 in /in/mH8jQ on line 6 bool(false) array(0) { }
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: unmatched parentheses at offset 21 in /in/mH8jQ on line 5 bool(false) array(0) { } Warning: Compilation failed: unmatched parentheses at offset 21 in /in/mH8jQ on line 6 bool(false) array(0) { }