pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fernando Schapachnik <fschapachnik@vianetworks.com.ar>
To: Samuel J. Sutjiono <ssutjiono@wc-group.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: Regular Expression for 'and' instead of 'or'
Date: Fri, 22 Feb 2002 15:15:14 -0300
Message-ID: <20020222151514.E2066@ns1.via-net-works.net.ar> (raw)
In-Reply-To: <023101c1bbc3$03a33910$110a010a@headquarters.wcgroup.com>
References: <023101c1bbc3$03a33910$110a010a@headquarters.wcgroup.com>

En un mensaje anterior, Samuel J. Sutjiono escribió:
> This expression matches the word socks or shoes or nike in product category 
> where productdescr ~* '(socks|shoes|nike)'
> 
> Does anybody know what the expression should be  if I want to do 'and' of those key words instead of 'or' ?

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).

Regards.



Fernando P. Schapachnik
Gerente de tecnología de red
y sistemas de información
VIA NET.WORKS ARGENTINA S.A.
fschapachnik@vianetworks.com.ar
Tel.: (54-11) 4323-3381



view thread (8+ messages)  latest in thread

Message-ID: <20020222151514.E2066@ns1.via-net-works.net.ar>
Permalink:  ../20020222151514.E2066@ns1.via-net-works.net.ar/
Also on:    postgresql.org/message-id/20020222151514.E2066@ns1.via-net-works.net.ar

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fschapachnik@vianetworks.com.ar, ssutjiono@wc-group.com, pgsql-general@postgresql.org
  Subject: Re: Regular Expression for 'and' instead of 'or'
  In-Reply-To: <20020222151514.E2066@ns1.via-net-works.net.ar>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox