agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Mark Williams <markwillimas@gmail.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: 'A. Sasaki' <asasaki@gmail.com>
Cc: pgsql-sql@lists.postgresql.org
Subject: RE: Regular Expressions
Date: Sun, 4 Nov 2018 20:02:44 -0000
Message-ID: <013b01d47479$5a3effd0$0ebcff70$@gmail.com> (raw)
In-Reply-To: <3966.1541361307@sss.pgh.pa.us>
References: <012401d47472$0ebc9240$2c35b6c0$@gmail.com>
<C8728C46-2154-4AF8-9E78-8085D49E5CE0@gmail.com>
<013401d47476$a7acf540$f706dfc0$@gmail.com>
<3966.1541361307@sss.pgh.pa.us>
Thanks all. Have implemented by way of "AND" for time being. Full text
search on my list of todos!
__
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: 04 November 2018 19:55
To: Mark Williams <markwillimas@gmail.com>
Cc: 'A. Sasaki' <asasaki@gmail.com>; pgsql-sql@lists.postgresql.org
Subject: Re: Regular Expressions
"Mark Williams" <markwillimas@gmail.com> 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
view thread (18+ messages) latest in thread
Message-ID: <013b01d47479$5a3effd0$0ebcff70$@gmail.com>
Permalink: ../013b01d47479$5a3effd0$0ebcff70$@gmail.com/
Also on: postgresql.org/message-id/013b01d47479$5a3effd0$0ebcff70$@gmail.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: markwillimas@gmail.com, tgl@sss.pgh.pa.us, asasaki@gmail.com, pgsql-sql@lists.postgresql.org
Subject: RE: Regular Expressions
In-Reply-To: <013b01d47479$5a3effd0$0ebcff70$@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox