Re: Help with a not match - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Help with a not match
Date
Msg-id CAKFQuwYbtcRfUy4iSOUqaJtnDOnAJ4vFW+wzrMgvev_r8yD-jg@mail.gmail.com
Whole thread Raw
In response to Re: Help with a not match  ("Campbell, Lance" <lance@illinois.edu>)
List pgsql-sql
On Fri, Nov 9, 2018 at 10:59 AM Campbell, Lance <lance@illinois.edu> wrote:

> SELECT regexp_matches(content, '/(?!files/'||id||'/)(files/\d+/)/', 'g') FROM tablea
> I get no matches.  My guess is I am close but slightly off on the syntax.

You have two forward slashes in a row at the end of the pattern:

( # capture
files/\d+/ #pattern, digits followed by slash, lead by files/
) # close capture
/ # another bracket - unlike Perl the // are not syntax but pattern

David J.


pgsql-sql by date:

Previous
From: "Campbell, Lance"
Date:
Subject: Re: Help with a not match
Next
From: Andrew Gierth
Date:
Subject: Re: Help with a not match