Regular expressions or LIKE ? HELP needed !

From: Hervé Piedvache <herve(at)elma(dot)fr>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Cc: pgman(at)candle(dot)pha(dot)pa(dot)us, Jean-Samuel Reynaud <reynaud(at)elma(dot)fr>
Subject: Regular expressions or LIKE ? HELP needed !
Date: 2002-08-01 10:21:10
Message-ID: 3D490B96.A3940593@elma.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have a little trouble ... my level with regular expression is not at
the top ... but I found two troubles and may I do not use them well ...
may be it's another things not detailed in any documentation of
PostgreSQL ...

Case 1 :
select name block where code ~* 'lower(';
ERROR: Invalid regular expression: parentheses ( ) not balanced

select name block where code ~* 'lower\(';
ERROR: Invalid regular expression: parentheses ( ) not balanced

How to escape a "(" ??

Case 2 :
select name from block where code ilike '%lower(%';
This is running ... ;)

But I want to find a text inside my field code having : lower(' inside
with the quote ("'") code at the end ... ok ?

So I thought I have to double the quote like this ... I have no result
... but I know result exists !
select name from block where code ike '%lower(''%';

I have also tried :
select name from block where code ike '%lower(\'%';
Same thing ... no result ... but I'm sure I have some !

Any idea how to escape the quote caracter in a LIKE ?

Many thanks for you help !

Regards,
--
Hervé Piedvache

Elma Ingenierie Informatique
6, rue du Faubourg Saint-Honoré
F-75008 - Paris - France
http://www.elma.fr
Tel: +33-1-44949901
Fax: +33-1-44949902
Email: herve(at)elma(dot)fr

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Holger Klawitter 2002-08-01 11:10:52 Re: Regular expressions or LIKE ? HELP needed !
Previous Message Karel Zak 2002-08-01 10:01:52 Re: getpid() function