Re: Regular Expression for 'and' instead of 'or' - Mailing list pgsql-general

From Tom Lane
Subject Re: Regular Expression for 'and' instead of 'or'
Date
Msg-id 19463.1014409239@sss.pgh.pa.us
Whole thread Raw
In response to Re: Regular Expression for 'and' instead of 'or'  (Fernando Schapachnik <fschapachnik@vianetworks.com.ar>)
Responses Strange Postgresql Indexing Behavior  (Brian Knox <laotse@aol.net>)
List pgsql-general
Fernando Schapachnik <fschapachnik@vianetworks.com.ar> writes:
> You have to use something like:

> '(socks.*shoes.*nike)|(socks.*nike.*shoes)|...'

> where ... is every other possible combination. Not pretty, but that's
> a limitation of finite automata (or regular expressions, which are
> the same).

Seems a lot easier to do

    WHERE field ~* 'socks' AND field ~* 'shoes' AND field ~* 'nike'

            regards, tom lane

pgsql-general by date:

Previous
From: Medi Montaseri
Date:
Subject: Re: A Replication Idea
Next
From: Fran Fabrizio
Date:
Subject: Re: Does iscachable work?