Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJOJ7-0004M6-33 for pgsql-sql@arkaria.postgresql.org; Sun, 04 Nov 2018 19:43:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gJOJ3-0006Q3-EQ for pgsql-sql@arkaria.postgresql.org; Sun, 04 Nov 2018 19:43:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJOJ3-0006Pw-2Q for pgsql-sql@lists.postgresql.org; Sun, 04 Nov 2018 19:43:33 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gJOJ0-0003tB-FY for pgsql-sql@lists.postgresql.org; Sun, 04 Nov 2018 19:43:31 +0000 Received: by mail-wr1-x433.google.com with SMTP id z13-v6so4781664wrs.3 for ; Sun, 04 Nov 2018 11:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:thread-index:content-language; bh=ngfrRb6to39CX3CY7+2VLPcDAsb1JEV+oO7jhSDThW4=; b=sZU2JDwABw8rtwGwNasByywJv6kccAWEOWYsCAHrLckOg18+u43tFXcxh9DClC9Nzb HSVxCR8HKDIIg6LbhfFP8m9G8Mc5sb1h28rAYpRFszBL6BBzxPSKlqYNyCVOKHtNRp9k eDHBdL4g7QlJTn+YeHdi1YlLX6yxic6r2/pRzlo5xhqr7F6QT1J6r9W02UDtxPCUTsXa EMt5GqMhSJXaQH9reA+dusXvLXPlcRXLtpt+mczxvcSftQWw/DAbLPc1Uj17hhEMAU4k yeIB08MoSby0InjEc0eCcjBajsVfFprgTJd4cR523K6gdDolzQznvDhumJNDX9J5QVrY WkKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:thread-index:content-language; bh=ngfrRb6to39CX3CY7+2VLPcDAsb1JEV+oO7jhSDThW4=; b=USMdkY1pYwEEROKzSTWiXwWGm2MacNXkRGAjRfJ3z5GRpZyTyhDXtjmT6IEN5Hzscs mHJTdP/ctRKuahr1koYn0fqMXgUs2hQr0TVOPBo3Pyt5BmhscR5b+a2cUNXLEUPQe/cl LLs0ot/w6RRTn11Nh9kO2gVbnCCd8Mt0ORr+CyxNuHf871BfERJKNpYW+7hLpx95ifn2 Yx1BPwD21ZmjBY4LR60xAiBDj+E7lFVmIn0qNhZmgwVTnnMh+zZQqEPbNVUGz1A2Xxz9 pH/Bf/TP+31E3FdC6Bk+XKyzuV+YlhLasCnP8A/3WOIiRrUmafvTUykm3LMgoDinTdfE Yt+Q== X-Gm-Message-State: AGRZ1gKaWrf0cVZKY4i2Usa9SdkvA9pY8FcklgENc0m6Z6HRaYnN8HSY nvnSG9huMfZmcto2y1W4dj/QoB/6 X-Google-Smtp-Source: AJdET5dgL3zf9Rr2xt0iyHFU8PZsGw2XWgeGlsV6AbGyAQcie0tuCsbQ6s+RJL/E8MvrnGem88FlhQ== X-Received: by 2002:adf:8542:: with SMTP id 60-v6mr8853440wrh.1.1541360608760; Sun, 04 Nov 2018 11:43:28 -0800 (PST) Received: from LAPTOPE7EH7MDP (167.221-30-62.static.virginmediabusiness.co.uk. [62.30.221.167]) by smtp.gmail.com with ESMTPSA id 195-v6sm43224323wmx.21.2018.11.04.11.43.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Nov 2018 11:43:28 -0800 (PST) From: "Mark Williams" To: "'A. Sasaki'" Cc: References: <012401d47472$0ebc9240$2c35b6c0$@gmail.com> In-Reply-To: Subject: RE: Regular Expressions Date: Sun, 4 Nov 2018 19:43:26 -0000 Message-ID: <013401d47476$a7acf540$f706dfc0$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0135_01D47476.A7AD6A70" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHimhpz5XmS/pxmKqn8nWJQE00UggFliUHmpRiMLAA= Content-Language: en-gb List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_0135_01D47476.A7AD6A70 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Andrew, =20 Thanks for the reply. =20 I tried the query, but it produced an error =E2=80=9Cinvalid regular = expression: quantifier operand invalid=E2=80=9D. =20 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? =20 =20 __ =20 From: A. Sasaki =20 Sent: 04 November 2018 19:30 To: Mark Williams Subject: Re: Regular Expressions =20 =E2=80=98(*\mtext1\M*\mtext2\M)|(*\mtext2\M*\mtext1\M)=E2=80=99 Thanks, =20 -Andrew- On Nov 4, 2018, at 9:10 AM, Mark Williams > wrote: If I wanted to search for whole words in a field I would use something = like: =20 Select * from mytable where myfield ~* =E2=80=98(\mtext1\M) | = (\mtext2\M)=E2=80=99 =20 This would find all instances of myfield containing either = =E2=80=9Ctext1=E2=80=9D or =E2=80=9Ctext2=E2=80=9D. =20 I can=E2=80=99t figure out how to search myfield for all instances which = contain =E2=80=9Ctext1=E2=80=9D AND =E2=80=9Ctext2=E2=80=9D. =20 In other words | is the OR operator. What is the AND operator. Tried + = and whilst that executes, it doesn=E2=80=99t return matching fields. =20 Thanks =20 Mark =20 __ =20 ------=_NextPart_000_0135_01D47476.A7AD6A70 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Hi Andrew,

 

Thanks for = the reply.

 

I tried the query, but it produced an error = =E2=80=9Cinvalid regular expression: quantifier operand = invalid=E2=80=9D.

 

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

 

=E2=80=98(*\mtext1\M*\mtext2\M)|(*\mtext2\= M*\mtext1\M)=E2=80=99

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 ~* =E2=80=98(\mtext1\M) | = (\mtext2\M)=E2=80=99

 

This would = find all instances of myfield containing either =E2=80=9Ctext1=E2=80=9D = or =E2=80=9Ctext2=E2=80=9D.

 

I = can=E2=80=99t figure out how to search myfield for all instances which = contain =E2=80=9Ctext1=E2=80=9D AND = =E2=80=9Ctext2=E2=80=9D.

 

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

 

Thanks

 

Mark

 

__

 

------=_NextPart_000_0135_01D47476.A7AD6A70--