Regular Expressions

From: "Mark Williams" <markwillimas(at)gmail(dot)com>
To: <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Regular Expressions
Date: 2018-11-04 19:10:31
Message-ID: 012401d47472$0ebc9240$2c35b6c0$@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

__

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Sasaki 2018-11-04 19:20:42 Re: Regular Expressions
Previous Message Jonathan S. Katz 2018-11-03 17:47:17 Re: Passinf field name