[SQL] Finding broken regex'es

2007-10-02 Thread Enrico Weigelt

Hi folks,


I'm looking for some way to find broken regex'es in some column
to kick them off. For now I'm regularily fetching all regexes
from an PHP script, try an preg_match() and so find the broken
ones to later remove them.

Is there any way to do this directly within the db ? 


thx
-- 
-
 Enrico Weigelt==   metux IT service - http://www.metux.de/
-
 Please visit the OpenSource QM Taskforce:
http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
http://patches.metux.de/
-

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [SQL] Finding broken regex'es

2007-10-02 Thread Erik Jones

On Oct 2, 2007, at 3:23 PM, Enrico Weigelt wrote:



Hi folks,


I'm looking for some way to find broken regex'es in some column
to kick them off. For now I'm regularily fetching all regexes
from an PHP script, try an preg_match() and so find the broken
ones to later remove them.

Is there any way to do this directly within the db ?


IIRC, if they're PERL compatible which it would seem from the php  
function you're using, no.  Postgres supports POSIX regexes but not  
(right now anyway) PERL regexes.


Erik Jones

Software Developer | Emma®
[EMAIL PROTECTED]
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com



---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [SQL] Finding broken regex'es

2007-10-02 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes:
> IIRC, if they're PERL compatible which it would seem from the php
> function you're using, no.  Postgres supports POSIX regexes but not
> (right now anyway) PERL regexes.

Actually what we support are Tcl (Henry Spencer) regexes, which are
about as powerful as Perl's but have a few minor incompatibilities.
Tcl and Perl regexes are both supersets of the POSIX requirements.

regards, tom lane

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [SQL] Finding broken regex'es

2007-10-02 Thread Erik Jones


On Oct 2, 2007, at 10:48 PM, Tom Lane wrote:


Erik Jones <[EMAIL PROTECTED]> writes:

IIRC, if they're PERL compatible which it would seem from the php
function you're using, no.  Postgres supports POSIX regexes but not
(right now anyway) PERL regexes.


Actually what we support are Tcl (Henry Spencer) regexes, which are
about as powerful as Perl's but have a few minor incompatibilities.
Tcl and Perl regexes are both supersets of the POSIX requirements.



Excellent point of information.  I was really just trying to focus on  
why the Postgres regex engine wouldn't be equivalent to the matching  
functionality of php's preg_* functions.  One example would be look  
behind assertions.  Btw, am I crazy or do I remember someone  
mentioning that support for Perl regexes possibly being added to  
Postgres in the future.


Erik Jones

Software Developer | Emma®
[EMAIL PROTECTED]
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [SQL] Finding broken regex'es

2007-10-02 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes:
> Btw, am I crazy or do I remember someone  
> mentioning that support for Perl regexes possibly being added to  
> Postgres in the future.

You can already get exact-Perl-behavior regexes by means of a plperl
wrapper function.  I can't really see any plausible argument for us
supporting both behaviors natively --- IMHO the three regex flavors
supported by Spencer's library are already two too many.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org