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 1gJNnH-000351-I9 for pgsql-sql@arkaria.postgresql.org; Sun, 04 Nov 2018 19:10:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gJNnF-0003Ot-LX for pgsql-sql@arkaria.postgresql.org; Sun, 04 Nov 2018 19:10:41 +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 1gJNnE-0003Oj-GT for pgsql-sql@lists.postgresql.org; Sun, 04 Nov 2018 19:10:40 +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 1gJNnB-0003Ed-5T for pgsql-sql@lists.postgresql.org; Sun, 04 Nov 2018 19:10:38 +0000 Received: by mail-wr1-x433.google.com with SMTP id x12-v6so7095893wrw.8 for ; Sun, 04 Nov 2018 11:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version:thread-index :content-language; bh=x/mRdR9jRtSjmSHR6dAlD4tgUJQ1+/Me25ZeV0z/D74=; b=bVQT3/qu2xCLSxoUd2Qh5nMDT+SaAOkrK3rjI3oPwxMOPxc4EUsKdZCJfHiCfh9/bh Wa48LbtkxQMmaOJmi1sz2NZU5FPURe4RAXXvbomF1FiAI1nVZCyaR8sT7AD5Bp3yN4JW NFms5D/fupL4lE3kJYtoLW00hQLMUE9G7wtMj3IlwkUv7AaAlmP0sNz/MhwBioo1RD1s vCbz4kIAHtSsV6obS5Qn7yFAu0R3wmvV3bJZ+vfx+aOLeR0vuPeDEHVIhkHXCZZaivdP ANJ4qEeFsGQXVEiYMBaUUtck6AktNpxH5DOZTOU/MPGcJq8+h2z0iBKdr8AmR4/kAlR/ 2ZnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :thread-index:content-language; bh=x/mRdR9jRtSjmSHR6dAlD4tgUJQ1+/Me25ZeV0z/D74=; b=BYpa86Pj1Ma4jpDVvQGoCEyrgGEJPXcLDx9jYY/u5vOlxbRaSe2mBhpMW+N5hsCWef lSZQ77EW/pj16Yi9qzQKuEp6nMlp1G6xUPzziMXofMAHxFZr5v/TZrB3II/YLtleRqrV kMUtOF8AxUnUGuyzeFHGAaoqVgI2VPbUf1Fiaqx9TbV+hJI/X0RcsldBqSMRoheENzj5 blcDRf5ClOUwCTr8qWJZp4juIoAGOOC5vWwUAz57uR+p53l5dtfN5uI8UI+ImOq/aK+4 PQlMG7tTwG+bZbSplUGkNT7zCgQVmEsRtOVfzm0QNq67blduwrLm9eSAYuCjt1ziv6QJ F93w== X-Gm-Message-State: AGRZ1gJdUnRSK4x2Kfc0qYaqjsV6iuby4t0kY7W8FxoCop2tWkZqGKsP wX6qJbkWfcBtWknx9wRgCC2kXs93 X-Google-Smtp-Source: AJdET5duzN34f8U0qQ8pzc+FrFvrTr1a1Djk8w3OTvH/yhd4wBn9vR/gCcVLvh9XwRB/RalqeAP6PQ== X-Received: by 2002:adf:8361:: with SMTP id 88-v6mr17191054wrd.192.1541358634376; Sun, 04 Nov 2018 11:10:34 -0800 (PST) Received: from LAPTOPE7EH7MDP (167.221-30-62.static.virginmediabusiness.co.uk. [62.30.221.167]) by smtp.gmail.com with ESMTPSA id v19-v6sm25651538wmd.20.2018.11.04.11.10.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Nov 2018 11:10:33 -0800 (PST) From: "Mark Williams" To: Subject: Regular Expressions Date: Sun, 4 Nov 2018 19:10:31 -0000 Message-ID: <012401d47472$0ebc9240$2c35b6c0$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0125_01D47472.0EBE3FF0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdR0cWicbXwTLAOqT7mw9vALN/4Jsg== 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_0125_01D47472.0EBE3FF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit If I wanted to search for whole words in a field I would use something like: Select * from mytable where myfield ~* '(\mtext1\M) | (\mtext2\M)' This would find all instances of myfield containing either "text1" or "text2". I can't figure out how to search myfield for all instances which contain "text1" AND "text2". In other words | is the OR operator. What is the AND operator. Tried + and whilst that executes, it doesn't return matching fields. Thanks Mark __ ------=_NextPart_000_0125_01D47472.0EBE3FF0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

If I wanted to search for whole words in a field I = would use something like:

 

Select * = from mytable where myfield ~* ‘(\mtext1\M) | = (\mtext2\M)’

 

This would = find all instances of myfield containing either “text1” or = “text2”.

 

I = can’t figure out how to search myfield for all instances which = contain “text1” AND “text2”.

 

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

 

Thanks

 

Mark

 

__

 

------=_NextPart_000_0125_01D47472.0EBE3FF0--