Skip site navigation (1) Skip section navigation (2)

Re: BUG #3788: POSIX regexp seems doesn't work for '(?!re) ' pattern

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Vitaly" <vitaly(dot)yakunin(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3788: POSIX regexp seems doesn't work for '(?!re) ' pattern
Date: 2007-11-29 16:24:12
Message-ID: 14553.1196353452@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Vitaly" <vitaly(dot)yakunin(at)gmail(dot)com> writes:
> SELECT author, type
>   FROM books WHERE "type" ~ '(?!novel)'; 

> This select work incorrect. It returns all types. 

Certainly.  That's a negative-lookahead pattern and is therefore
guaranteed to match somewhere in every string (at the end, if
nowhere else).

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Mike C.Date: 2007-11-30 01:05:35
Subject: BUG #3790: pg_restore error canceling statement due to user request
Previous:From: VitalyDate: 2007-11-29 15:35:24
Subject: BUG #3788: POSIX regexp seems doesn't work for '(?!re) ' pattern

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group