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=.*?,')
UPD3:
Yes, it seems to be a bug.
Can anyone provide Oracle Support reaction on this issue?
Is the bug already known?
Does it have an ID?