Re: [BUGS] problem with non-greedy regex match

2009-01-13 Thread Tom Lane
"Merlin Moncure" writes: > I _may_ have found a problem that is affecting non-greedy regex matches. No, you didn't read the fine print in section 9.7.3.5; particularly A branch -- that is, an RE that has no top-level | operator -- has the same greediness as the first quantified atom in i

[BUGS] problem with non-greedy regex match

2009-01-13 Thread Merlin Moncure
I _may_ have found a problem that is affecting non-greedy regex matches. select regexp_matches( $$x = foo y x = foo y $$, $$x\s+(.*?)y$$ ,'g'); As I read it, this should match ' = foo' twice. Instead, it matches "= foo y x = foo " once. The non-greedy form (.*?) should break out at the fir