Why non-greedy quantifier sometimes doesn't work in Oracle regex?
IMO, this query should return A=1,B=2, SELECT regexp_substr('A=1,B=2,C=3,', '.*B=.*?,') as A_and_B FROM dual But it returns whole string A=1,B=2,C=3, instead. Why? UPD: Oracle 10.2+ required to use Perl-style metacharacters in regular expressions. UPD2: More clear form of my question (to avoid questions about Oracle version and availability of Perl-style regex extension): Why ON THE SAME SYSTEM non-greedy quantifier sometimes works as expected and sometimes doesn't? This works correctly: regexp_substr('A=1,B=2,C=3,', 'B=.*?,') This doesn't work: regexp_substr('A=1,B=2,C=3,', '.*B=.*?,') fiddle