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 1gJbaC-00012g-EK for pgsql-sql@arkaria.postgresql.org; Mon, 05 Nov 2018 09:54:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gJbaA-00078b-6S for pgsql-sql@arkaria.postgresql.org; Mon, 05 Nov 2018 09:54:06 +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 1gJR8a-00088o-0K for pgsql-sql@lists.postgresql.org; Sun, 04 Nov 2018 22:44:56 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gJR8S-0004m4-RJ for pgsql-sql@lists.postgresql.org; Sun, 04 Nov 2018 22:44:55 +0000 Received: by mail-pg1-x52e.google.com with SMTP id 32-v6so3316797pgu.2 for ; Sun, 04 Nov 2018 14:44:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rNdf1UFdWW6MYaLrnEZudCy4U0v1XQ1D/ICdPhFZunU=; b=q2YG91jDwuWR5FqgAAhubghA8EYulzeJwHOYxI1UEFcJuCT//Euo59F7IgjoiMboJc U/CIXsTU5xMqRHdG21DejDs5SpJbQXKBAnqkCLNvN+w7c69X1ygUEAarjoaETk//K+Rm xnHwBly19BGWmeXwYSJjKCJdwSyPM63VmBMSzhGurdoRGBLv+50Edf7KgJ4fzzC0bmYt XqMsx5zzaiodre1IjSU8/l2LrvbesFLQUZ8LsYnZzpsBADQ796+h/W9OVP7BZ6RUTh6B k/ivVJzvF66GK2/LzoNv7p/439Tl2jHbFdQ5KWHz4N/zg8/XuExGPq8A+cLuH2tFogES JNSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rNdf1UFdWW6MYaLrnEZudCy4U0v1XQ1D/ICdPhFZunU=; b=JhEMs4Z59YDB80+N535vjk2/tPUOmMC5ZElDlmvmPAYT4iW5exJZEAe48AEJz7ne2H BeMvx/pV9M3OJ4py8AbvBz5xKu1hIPDDu5ZalNn13FBN0glMg4q6SUB+36pNYLWl3odB DaCmvYsu0o4Ko7ihZN7kFQhSaxvIyji5QHxp+J7OlCb9jx3RJz49rrJ8HMOjsKs/aVk3 2jf12yxZlaYKcbpTadL9HQjwblIZsvGs2CjVtR0TSwBn38HvyOXr6C9bDrpOBoRwIhHN 3dELax1vzCr0nUwbtUZFbaacu49S9jh1ijduW/iU/sijUEAqaWAJhXfDPiIHFSJGoEFc 0cNA== X-Gm-Message-State: AGRZ1gKGXj9NEejFKUUcsipkBFmSnfil2C0ByE9UsDXwtuOvMfzOzTue 5+q+8idiSO3zkqGUjXVzomY= X-Google-Smtp-Source: AJdET5ej2qFpn/I591OThnF0KltfRL2GYHZUtXODspxzVIAgownXxn3FJWJmI+bplhEgHOUZZsUnXg== X-Received: by 2002:a62:13d6:: with SMTP id 83-v6mr19466175pft.34.1541371485225; Sun, 04 Nov 2018 14:44:45 -0800 (PST) Received: from ?IPv6:2605:e000:c7c4:f400:94d7:99a4:a4a9:6e83? ([2605:e000:c7c4:f400:94d7:99a4:a4a9:6e83]) by smtp.gmail.com with ESMTPSA id 27-v6sm69055184pfm.36.2018.11.04.14.44.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Nov 2018 14:44:44 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-66000FB1-E805-4998-A720-85414508E20A Mime-Version: 1.0 (1.0) Subject: Re: Regular Expressions From: "A. Sasaki" X-Mailer: iPad Mail (16A366) In-Reply-To: <013401d47476$a7acf540$f706dfc0$@gmail.com> Date: Sun, 4 Nov 2018 12:44:43 -1000 Cc: pgsql-sql@lists.postgresql.org Content-Transfer-Encoding: 7bit Message-Id: References: <012401d47472$0ebc9240$2c35b6c0$@gmail.com> <013401d47476$a7acf540$f706dfc0$@gmail.com> To: Mark Williams List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-66000FB1-E805-4998-A720-85414508E20A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 functional= ity: =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 wrote: >=20 > Hi Andrew, > =20 > Thanks for the reply. > =20 > I tried the query, but it produced an error =E2=80=9Cinvalid regular expre= ssion: quantifier operand invalid=E2=80=9D. > =20 > Also, what would be the regular expression if you want to check whether al= l the words were in the field where you had say 10 words/phrases you wanted t= o 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 >=20 > Thanks, > =20 > -Andrew- >=20 > On Nov 4, 2018, at 9:10 AM, Mark Williams wrote: >=20 > If I wanted to search for whole words in a field I would use something lik= e: > =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 c= ontain =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 --Apple-Mail-66000FB1-E805-4998-A720-85414508E20A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable I didn=E2=80=99t test it in a DB, sorry =E2= =80=99bout that.

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

=E2=80=98S= elect *
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 i= t produced an error =E2=80=9Cinvalid regular expression: quantifier operand i= nvalid=E2=80=9D.

 

<= p class=3D"MsoNormal">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?

=  

 

__<= /p>

 

From:= A. Sas= aki <asasaki@gmail.com>
<= b>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-<= o:p>


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 u= se something like:

 

Select * from mytable where myfield ~* =E2=80=98(\mt= ext1\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.<= /o:p>

 

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

 

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

 

Thanks

 

Mark

 

__

 

= --Apple-Mail-66000FB1-E805-4998-A720-85414508E20A--