- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?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);