Received: from qmsql.netservers.net (hpmail1.netservers.net [209.196.128.163]) by postgresql.org (Postfix) with SMTP id 2221747630C for ; Fri, 22 Feb 2002 13:43:15 -0500 (EST) Received: (qmail 50472 invoked from network); 22 Feb 2002 18:38:35 -0000 Received: from unknown (HELO AARON) (66.26.63.73) by hpmail1.netservers.net with SMTP; 22 Feb 2002 18:38:35 -0000 Message-ID: <025b01c1bbcf$81dccc40$110a010a@headquarters.wcgroup.com> From: "Samuel J. Sutjiono" To: "Fernando Schapachnik" Cc: , References: <023101c1bbc3$03a33910$110a010a@headquarters.wcgroup.com> <20020222151514.E2066@ns1.via-net-works.net.ar> Subject: Re: [SQL] Regular Expression for 'and' instead of 'or' Date: Fri, 22 Feb 2002 13:34:04 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200202/1072 X-Sequence-Number: 21069 Thank you very much Fernando. Do you know whether this expression (regex) use index scan ? Regards, Sam ----- Original Message ----- From: "Fernando Schapachnik" To: "Samuel J. Sutjiono" Cc: ; Sent: Friday, February 22, 2002 1:15 PM Subject: Re: [SQL] [GENERAL] Regular Expression for 'and' instead of 'or' > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >