[GENERAL] Pattern Matching question - PG 9.6 - Mailing list pgsql-general

From Patrick B
Subject [GENERAL] Pattern Matching question - PG 9.6
Date
Msg-id CAJNY3itxKZQYsvTFsHGmCB+_T-Upb4rop5NXSDC_uOM8oBHR8g@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Pattern Matching question - PG 9.6  (Patrick B <patrickbakerbr@gmail.com>)
Re: [GENERAL] Pattern Matching question - PG 9.6  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
AS you can see above, when performing this query:
SELECT * FROM test1 WHERE client_id = 10 AND path ~ '^/testfile/client/[0-9]+/attachment/(([0-9]{1,14})|(unassigned))/'

I get 5 rows. But actually I only want/need 3 of them:

  • with the 'master' variation
  • and if it is unassigned (attachment/unassigned); then i want it too

The rows that I should be getting are:

5   /testfile/client/10/attachment/1000/master/   10

7   /testfile/client/10/attachment/unassigned/file/1001/master   10

8   /testfile/client/10/attachment/unassigned/file/1002/master   10


What am I doing wrong?

Thanks

Patrick.

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: [GENERAL] Top posting....
Next
From: Patrick B
Date:
Subject: Re: [GENERAL] Pattern Matching question - PG 9.6