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 1gJc1D-0002Kd-El for pgsql-sql@arkaria.postgresql.org; Mon, 05 Nov 2018 10:22:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gJc1B-0000TY-DL for pgsql-sql@arkaria.postgresql.org; Mon, 05 Nov 2018 10:22:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gJc1B-0000TR-4a for pgsql-sql@lists.postgresql.org; Mon, 05 Nov 2018 10:22:01 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gJc14-0003O4-7q for pgsql-sql@lists.postgresql.org; Mon, 05 Nov 2018 10:22:00 +0000 Received: by mail-wr1-x42d.google.com with SMTP id j26-v6so8865324wre.1 for ; Mon, 05 Nov 2018 02:21:53 -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=gKy1eruXCyvQ7dp1mo4az+tRIAJ31CMyU49QRLaEnNA=; b=lbCgUqPcJE4aKevGa5ywqN9lWSuvBi9KZHRrOY90DKD/bSebXW8ttX1Ak2kO4RSiVo Gov8UdSuTiNSqgEBGbva7soGQIdDW20YzNvIsyDaNgbkbiOsu4zY1fffA78AvPTXO7fn WYnh/Mrvo3VB9nFbl8GBDYc2gHz8IwWf+QuUS53qymXvdLdCNNW32/6VEig93Fviy7tN 8eFpExMfxEEhw0VcZFITvG5KceX8js+RbRnad8H4CQseoiDmCbwAWrO3My5H/EfrmdAl HSNXIUCC1kqeXHQ3CEp4xYDqHUmldpusIp+j6PU6iVvy68wal3Afw7MXq4DQX9VA4dVY JAaA== 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=gKy1eruXCyvQ7dp1mo4az+tRIAJ31CMyU49QRLaEnNA=; b=iX0Gx0uRAp52IeLkOKUmAXD3k3VSTN+gyfqfhHLPi/pBWPY5y7eYcQ3GBLbNLf4HPO mB008Qrs/4OEaa1tsf+hVUxYLf5P+in7HbohnyTRmWvIQ/5Bf31+/2Q7+PZKq6Qe7/1K IllvdxydPAvYoiBg9dzf2MV/M4CENa4IxcC/ShAE6BAabj6pdhCDJotN0ZP34keEufJg maQcNnzcTPEGka4nIt/aAgkrEogaNiRmNxGsCKeq2fRtEWUsDoKhoX5jMP3zicB03YOv LFkgxFRldbHJQaOmJ1uvqFXfMZ9gfbj484EFBUdvLXRomyPcGWPkshjfI15UAuXeJh2q eHLw== X-Gm-Message-State: AGRZ1gIgSa2bQfuTfjfA71OnVP0BVKPCWJ4VImmAoY5yvIaY0TjnQRMR 60DHZXLWF+KNvyPSveNMsmQ= X-Google-Smtp-Source: AJdET5eQDSmB5UEiKLmf/Ili2lJNDB7dVmgizyBMzdGtctJmzVS0cnUmonr+YMbUn8SK6amjW2AYZQ== X-Received: by 2002:adf:84a4:: with SMTP id 33-v6mr18955503wrg.191.1541413311339; Mon, 05 Nov 2018 02:21:51 -0800 (PST) Received: from LAPTOPE7EH7MDP (167.221-30-62.static.virginmediabusiness.co.uk. [62.30.221.167]) by smtp.gmail.com with ESMTPSA id p19-v6sm21847594wmc.46.2018.11.05.02.21.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 02:21:50 -0800 (PST) From: "Mark Williams" To: "'A. Sasaki'" Cc: References: <012401d47472$0ebc9240$2c35b6c0$@gmail.com> <013401d47476$a7acf540$f706dfc0$@gmail.com> In-Reply-To: Subject: RE: Regular Expressions Date: Mon, 5 Nov 2018 10:21:48 -0000 Message-ID: <014301d474f1$5d1b5640$175202c0$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0144_01D474F1.5D1DEE50" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHimhpz5XmS/pxmKqn8nWJQE00UggFliUHmAfgEcPoCPKYbTKT33Mgg 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_0144_01D474F1.5D1DEE50 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable No problem. That=E2=80=99s how I have now gone about it. =20 __ =20 From: A. Sasaki =20 Sent: 04 November 2018 22:45 To: Mark Williams Cc: pgsql-sql@lists.postgresql.org Subject: Re: Regular Expressions =20 I didn=E2=80=99t test it in a DB, sorry =E2=80=99bout that. =20 I think others are on the right track here, using SQL for the AND = functionality: =20 =E2=80=98Select * FROM [TABLE] WHERE [regex search 1] AND [regex search 2] AND [regex search 3] ....=E2=80=99 Thanks, =20 -Andrew- On Nov 4, 2018, at 9:43 AM, Mark Williams > wrote: 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_0144_01D474F1.5D1DEE50 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

No problem. That=E2=80=99s how I have now gone about = it.

 

__

 

From: A. Sasaki = <asasaki@gmail.com>
Sent: 04 November 2018 = 22:45
To: Mark Williams = <markwillimas@gmail.com>
Cc: = pgsql-sql@lists.postgresql.org
Subject: Re: Regular = Expressions

 

I = didn=E2=80=99t test it in a DB, sorry =E2=80=99bout that.

 

I = think others are on the right track here, using SQL for the AND = functionality:

 

=E2=80=98Select *

FROM [TABLE]

WHERE [regex search 1]

AND [regex search 2]

AND [regex search = 3]
....=E2=80=99

Thanks,

 

-Andrew-


On Nov 4, 2018, at = 9:43 AM, Mark Williams <markwillimas@gmail.com> = wrote:

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_0144_01D474F1.5D1DEE50--