Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22690 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40368 invoked by uid 1010); 9 Apr 2006 16:33:05 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 40352 invoked from network); 9 Apr 2006 16:33:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2006 16:33:05 -0000 X-Host-Fingerprint: 217.79.190.163 r163.red.fastwebserver.de Received: from ([217.79.190.163:4644] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B8/D7-09839-14739344 for ; Sun, 09 Apr 2006 12:33:05 -0400 To: internals@lists.php.net Date: Sun, 9 Apr 2006 18:33:01 +0200 Message-ID: <20060409183301.2593cf1b@localhost.localdomain> Reply-To: pierre.php@gmail.com X-Newsreader: Sylpheed-Claws 2.1.0 (GTK+ 2.8.6; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Posted-By: 217.79.190.163 Subject: ext/filter, preg_* compatibility From: pierre.php@gmail.com (Pierre) 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