Re: Regular Expressions

"A. Sasaki" <[email protected]> Sun, 4 Nov 2018 09:20:42 -1000
Newsgroups gmane.comp.db.postgresql.sql
Message-ID <[email protected]>
‘(*\mtext1\M*\mtext2\M)|(*\mtext2\M*\mtext1\M)’

Thanks,

-Andrew-

> On Nov 4, 2018, at 9:10 AM, Mark Williams <[email protected]> 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
>  
> __
>