Re: Regular Expressions

Tom Lane <[email protected]> Sun, 04 Nov 2018 14:55:07 -0500
Newsgroups gmane.comp.db.postgresql.sql
Message-ID <[email protected]>
"Mark Williams" <[email protected]> writes:
> 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?

As David said, regular expressions aren't really designed to do that.
Personally I'd do the AND at the SQL level, ie

myfield ~* '\mtext1\M' AND myfield ~* '\mtext2\M' AND ...

You might also take a look at the full text search machinery, which
is probably better suited to this task.

			regards, tom lane