Received: from ns1.via-net-works.net.ar (ns1.via-net-works.net.ar [200.10.100.10]) by postgresql.org (Postfix) with ESMTP id D6334475E72; Fri, 22 Feb 2002 13:15:28 -0500 (EST) Received: (from fpscha@localhost) by ns1.via-net-works.net.ar (8.9.3/8.9.3) id PAA49730; Fri, 22 Feb 2002 15:15:14 -0300 (ART) X-Authentication-Warning: ns1.via-net-works.net.ar: fpscha set sender to fschapachnik@vianetworks.com.ar using -f Date: Fri, 22 Feb 2002 15:15:14 -0300 From: Fernando Schapachnik To: "Samuel J. Sutjiono" Cc: pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: Regular Expression for 'and' instead of 'or' Message-ID: <20020222151514.E2066@ns1.via-net-works.net.ar> References: <023101c1bbc3$03a33910$110a010a@headquarters.wcgroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <023101c1bbc3$03a33910$110a010a@headquarters.wcgroup.com>; from ssutjiono@wc-group.com on Fri, Feb 22, 2002 at 12:04:38PM -0500 X-Archive-Number: 200202/1067 X-Sequence-Number: 21064 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