Re: BUG #8605: Regular expression lazy quantification issue - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #8605: Regular expression lazy quantification issue
Date
Msg-id 12547.1384883531@sss.pgh.pa.us
Whole thread Raw
In response to BUG #8605: Regular expression lazy quantification issue  (atoriwork@gmail.com)
List pgsql-bugs
atoriwork@gmail.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

pgsql-bugs by date:

Previous
From: atoriwork@gmail.com
Date:
Subject: BUG #8605: Regular expression lazy quantification issue
Next
From: Bruce Momjian
Date:
Subject: Re: postmaster.c and random keys/salts