Re: BUG #8605: Regular expression lazy quantification issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: atoriwork(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8605: Regular expression lazy quantification issue
Date: 2013-11-19 17:52:11
Message-ID: 12547.1384883531@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

atoriwork(at)gmail(dot)com writes:
> Lazy quantificators does't work after "or" block in regexp mask
> ('(a)|(b)'):

This isn't a bug, it's documented behavior. See
http://www.postgresql.org/docs/9.2/static/functions-matching.html#POSIX-MATCHING-RULES
specifically the bit that an RE containing an | operator is always greedy.
The non-greedy operators within it are constrained to match as little
as possible, but that happens after determining the overall match, which
will be greedy.

I realize that this might not be the behavior you'd like, but we're
unlikely to change it.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2013-11-19 18:25:29 Re: postmaster.c and random keys/salts
Previous Message Robert Haas 2013-11-19 17:27:41 Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist