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

Поиск
Список
Период
Сортировка
От joe@tsolucio.com (Joe Bordes)
Тема how to test string against regular expression contained in postgresql database field?
Дата
Msg-id 9a0f19e3.0403231433.5c404584@posting.google.com
обсуждение исходный текст
Ответы Re: how to test string against regular expression contained in postgresql  (CoL <col@mportal.hu>)
Re: how to test string against regular expression contained in postgresql database field?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Hi All,

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.

table
os_regexp os_name
------------- -----------
win.*9x windows
linux linux
etc...

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


Any help appreciated, Joe.

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

Предыдущее
От: billybobc1210@yahoo.com (Bill C.)
Дата:
Сообщение: Problems getting started: createdb fails
Следующее
От: "Derrick Betts"
Дата:
Сообщение: Extract Function