trouble with regular expression

From: Pushker Chaubey <pchaubey(at)vertex(dot)co(dot)in>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: trouble with regular expression
Date: 2008-06-04 18:08:43
Message-ID: 4846DA2B.2030606@vertex.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi experts,

I have a problem regarding regular expression.

In my database (version 8.0.2 ) I have a value stored as
"([t]{0,1})^(t?)+$\"
(Please note that this value uses many characters which have special
meaning in regular expression)

Earlier I had a query which used to fetch this value
SELECT "Topic" FROM "schema1"."Topics" WHERE "Topic" *similar to*
'\\(\\[t\\]{0,1}\\)\\^\\(t?\\)\\+\\$\\\\' ORDER BY "Topic"
This query worked fine and did return the matching value stored in
database .

Later on to support, case insensitive value search, I modified the query to
SELECT "Topic" FROM "schema1"."Topics" WHERE "Topic" ~** *
'\\(\\[t\\]{0,1}\\)\\^\\(t?\\)\\+\\$\\\\' ORDER BY "Topic"

(Please note that I just replaced similar to with ~*)

The new query does not work. Please let me know where I am making a mistake.
If there are other approaches to go about case insensitive pattern
matching in query, please provide pointers to that.

Thanks in advance.

Regards,
Pushker Chaubey

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy the original message all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

Please do not print this email unless it is absolutely necessary.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2008-06-04 18:37:29 Re: trouble with regular expression
Previous Message tivvpgsqljdbc 2008-06-04 08:27:53 Re: How to just "link" to some data feed