how to test string against regular expression contained in postgresql database field? - Mailing list pgsql-novice

From joe@tsolucio.com (Joe Bordes)
Subject how to test string against regular expression contained in postgresql database field?
Date
Msg-id 9a0f19e3.0403231433.5c404584@posting.google.com
Whole thread Raw
Responses Re: how to test string against regular expression contained in postgresql
Re: how to test string against regular expression contained in postgresql database field?
List 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 by date:

Previous
From: billybobc1210@yahoo.com (Bill C.)
Date:
Subject: Problems getting started: createdb fails
Next
From: "Derrick Betts"
Date:
Subject: Extract Function