Re: Checking regex pattern validity

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Checking regex pattern validity
Date: 2004-09-15 14:08:47
Message-ID: 3231.1095257327@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com> writes:
> Is there a function like IS_VALID_REGEX() to check whether a pattern is
> valid (i.e. it compiles)? I'm storing a list of regex patterns in a
> table. It would be nice to be able to add a CHECK constraint to ensure
> that all the regexes are valid.

... CHECK (('' ~ pattern) IS NOT NULL) ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leonardo Francalanci 2004-09-15 14:10:29 what is flushed?
Previous Message Tom Lane 2004-09-15 13:57:41 Re: Rollback on Error