Re: how to test string against regular expression contained in postgresql database field?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how to test string against regular expression contained in postgresql database field?
Дата
Msg-id 26388.1080329607@sss.pgh.pa.us
обсуждение исходный текст
Ответ на how to test string against regular expression contained in postgresql database field?  (joe@tsolucio.com (Joe Bordes))
Список pgsql-novice
joe@tsolucio.com (Joe Bordes) writes:
> I have a table which contains a field with regular expressions. I want
> to test a given string against this field to obtain the resulting
> records but I am doing something wrong and cannot find out what.

> select os_name from table where 'windows9x' ~ os_regexp;
> ERROR: invalid regular expression: empty expression or subexpression.

Looks to me like there's at least one row in the table whose os_regexp
is wrong.  I'm not quite sure *why* it's wrong ... I tried a few
examples to see if I could duplicate that message, and I couldn't find
one.  But you want to look to the regexps themselves, the query is fine.

            regards, tom lane

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: how to test string against regular expression contained
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Extract Function