Re: How to use like with a list

From: John R Pierce <pierce(at)hogranch(dot)com>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to use like with a list
Date: 2011-11-18 20:23:10
Message-ID: 4EC6BEAE.1040904@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/18/11 12:18 PM, Richard Broersma wrote:
> On Fri, Nov 18, 2011 at 12:13 PM, John R Pierce<pierce(at)hogranch(dot)com> wrote:
>
>> > where field ~ '^(jo|mo|do|fo)'
> Don't forget to add the l as the end:
>
> where field ~ '^(jo|mo|do|fo)l'

ah, yeah, that.

and to complete the original requirement...

where field ~ '^(' || replace(?, ',', '|') || ')l'

btw, no need for a .* on the end, since the regex isn't anchored at the
end with a $

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2011-11-18 20:37:18 Re: How to use like with a list
Previous Message Richard Broersma 2011-11-18 20:18:41 Re: How to use like with a list