Regular expressions or LIKE ? HELP needed ! - Mailing list pgsql-general

From Hervé Piedvache
Subject Regular expressions or LIKE ? HELP needed !
Date
Msg-id 3D490B96.A3940593@elma.fr
Whole thread Raw
Responses Re: Regular expressions or LIKE ? HELP needed !  (Holger Klawitter <lists@klawitter.de>)
List 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@elma.fr

pgsql-general by date:

Previous
From: Karel Zak
Date:
Subject: Re: to_char(0,'FM990D99') = "0." instead of "0"
Next
From: Holger Klawitter
Date:
Subject: Re: Regular expressions or LIKE ? HELP needed !