Re: Regular expressions or LIKE ? HELP needed !

From: Holger Klawitter <lists(at)klawitter(dot)de>
To: herve(at)elma(dot)fr, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Regular expressions or LIKE ? HELP needed !
Date: 2002-08-01 11:10:52
Message-ID: 200208011310.52745.lists@klawitter.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> How to escape a "(" ??

select name block where code ~* 'lower\\(';

First, you have to escape the '(' in order to make regexps match the bracket
instead of using it as a grouping operator.

And then you have to escape the escape in order to get it passed to the regexp
system (at least with psql).

> select name from block where code ike '%lower(''%';

Works for me in 7.2.1 (ike should be ilike). Which postgres version are you
running?

With kind regards / mit freundlichem Gruß
Holger Klawitter
--
Holger Klawitter http://www.klawitter.de
lists(at)klawitter(dot)de

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Hintermayer 2002-08-01 12:39:27 Re: very slow updates
Previous Message Hervé Piedvache 2002-08-01 10:21:10 Regular expressions or LIKE ? HELP needed !