Re: Regular Expression for 'and' instead of 'or'

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Regular Expression for 'and' instead of 'or'
Дата
Msg-id Pine.LNX.4.30.0202221543100.686-100000@peter.localdomain
обсуждение исходный текст
Ответ на Regular Expression for 'and' instead of 'or'  ("Samuel J. Sutjiono" <ssutjiono@wc-group.com>)
Список pgsql-sql
Samuel J. Sutjiono writes:

> 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 probably want something like

productdescr ~* 'socks' AND productdescr ~* 'shoes' AND productdescr ~* 'nike'

I don't think it's possible to do this for the general case with just a
regular expression.

--
Peter Eisentraut   peter_e@gmx.net


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Regular Expression for 'and' instead of 'or'
Следующее
От: Mark Nielsen
Дата:
Сообщение: How do I return more than one value in a postgresql pl/pgsql procedure?