Re: trouble with regular expression - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: trouble with regular expression
Date
Msg-id 27826.1212604649@sss.pgh.pa.us
Whole thread Raw
In response to trouble with regular expression  (Pushker Chaubey <pchaubey@vertex.co.in>)
Responses Re: trouble with regular expression
List pgsql-jdbc
Pushker Chaubey <pchaubey@vertex.co.in> writes:
> (Please note that I just replaced similar to with ~*)

They're not the same ... SIMILAR TO is SQL-spec which is almost entirely
unlike POSIX.

You can get there using the undocumented similar_escape function:
"a SIMILAR TO b" is actually implemented as "a ~ similar_escape(b,null)",
so "a ~* similar_escape(b,null)" should do what you want.

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Pushker Chaubey
Date:
Subject: trouble with regular expression
Next
From: Pushker Chaubey
Date:
Subject: Re: trouble with regular expression