ext/filter, preg_* compatibility

php.internals

Pierre Joye

20 years ago
Hello, While testing pecl/filter, I noticed that many tests fail. Many of the errors are related to the FILTER_VALIDATE_REGEXP mode. This mode uses pcre natively to compile and execute the give regex. It is not compatible with the php pcre extension, which makes its usage a bit tricky, to port existing applications is even more annoying. Here is a first patch: http://pear.php.net/~pierre/filter_pcre.txt It uses pcre_get_compiled_regex from ext/pcre to compile the regex and fixes a little bug (matches can zero, see the comment). The benefits are: - compatible with ext/pcre - use of the compiled expressions cache It would also be nice if every additions to ext/filter will use the ext/pcre API. --Pierre