RE: Regular Expressions

Поиск
Список
Период
Сортировка
От Mark Williams
Тема RE: Regular Expressions
Дата
Msg-id 013401d47476$a7acf540$f706dfc0$@gmail.com
обсуждение исходный текст
Ответ на Regular Expressions  ("Mark Williams" <markwillimas@gmail.com>)
Ответы Re: Regular Expressions  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Regular Expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Regular Expressions  ("A. Sasaki" <asasaki@gmail.com>)
Список pgsql-sql

Hi Andrew,

 

Thanks for the reply.

 

I tried the query, but it produced an error “invalid regular expression: quantifier operand invalid”.

 

Also, what would be the regular expression if you want to check whether all the words were in the field where you had say 10 words/phrases you wanted to check for?

 

 

__

 

From: A. Sasaki <asasaki@gmail.com>
Sent: 04 November 2018 19:30
To: Mark Williams <markwillimas@gmail.com>
Subject: Re: Regular Expressions

 

‘(*\mtext1\M*\mtext2\M)|(*\mtext2\M*\mtext1\M)’

Thanks,

 

-Andrew-


On Nov 4, 2018, at 9:10 AM, Mark Williams <markwillimas@gmail.com> wrote:

If I wanted to search for whole words in a field I would use something like:

 

Select * from mytable where myfield ~* ‘(\mtext1\M) | (\mtext2\M)’

 

This would find all instances of myfield containing either “text1” or “text2”.

 

I can’t figure out how to search myfield for all instances which contain “text1” AND “text2”.

 

In other words | is the OR operator. What is the AND operator. Tried + and whilst that executes, it doesn’t return matching fields.

 

Thanks

 

Mark

 

__

 

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Regular Expressions
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Regular Expressions