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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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