From: | Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com> |
---|---|
To: | Holger Klawitter <lists(at)klawitter(dot)de>, 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 13:22:32 |
Message-ID: | 20020801132232.53848.qmail@web20810.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
A safe method that always works is simply to use a
character class, like:
select name block where code ~* 'lower [(]'
--- Holger Klawitter <lists(at)klawitter(dot)de> wrote:
>
> > 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
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org
> so that your
> message can get through to the mailing list cleanly
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Holger Klawitter | 2002-08-01 14:06:10 | Re: Regular expressions or LIKE ? HELP needed ! |
Previous Message | Thomas Lockhart | 2002-08-01 13:21:11 | Re: problem insert time into column timestamp |