Re: Checking regex pattern validity

Поиск
Список
Период
Сортировка
От David Garamond
Тема Re: Checking regex pattern validity
Дата
Msg-id 414995BE.4050803@zara.6.isreserved.com
обсуждение исходный текст
Ответ на Re: Checking regex pattern validity  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> 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) ...

Not exactly what I wanted, but close enough. Thanks!

However, what if only want to accept invalid regex patterns? Or what if
invalid pattern should be converted to NULL automatically? I'd still
vote for a function...

--
dave

В списке pgsql-general по дате отправления:

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: Postgresql <--> webservices?
Следующее
От: Bill Moran
Дата:
Сообщение: Re: Postgresql <--> webservices?