Re: [SQL] Regular Expression for 'and' instead of 'or'
От | Samuel J. Sutjiono |
---|---|
Тема | Re: [SQL] Regular Expression for 'and' instead of 'or' |
Дата | |
Msg-id | 025b01c1bbcf$81dccc40$110a010a@headquarters.wcgroup.com обсуждение исходный текст |
Ответ на | Regular Expression for 'and' instead of 'or' ("Samuel J. Sutjiono" <ssutjiono@wc-group.com>) |
Список | pgsql-general |
Thank you very much Fernando. Do you know whether this expression (regex) use index scan ? Regards, Sam ----- Original Message ----- From: "Fernando Schapachnik" <fschapachnik@vianetworks.com.ar> To: "Samuel J. Sutjiono" <ssutjiono@wc-group.com> Cc: <pgsql-sql@postgresql.org>; <pgsql-general@postgresql.org> 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) >
В списке pgsql-general по дате отправления: