Re: Checking regex pattern validity - Mailing list pgsql-general

From Tom Lane
Subject Re: Checking regex pattern validity
Date
Msg-id 3231.1095257327@sss.pgh.pa.us
Whole thread Raw
In response to Checking regex pattern validity  (David Garamond <lists@zara.6.isreserved.com>)
Responses Re: Checking regex pattern validity
List pgsql-general
David Garamond <lists@zara.6.isreserved.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rollback on Error
Next
From: John Sidney-Woollett
Date:
Subject: psql + autocommit