I'm trying to get the following Regex expression to work with Oracle SQL:
select regexp_replace(' "abc_78": 123, ', '.*?abc.*?: (.*?),.*', '\1') from dual;
select regexp_replace(' "abc_78": 123, "def_79": [', '.*?abc.*?: (.*?),', '\1') from dual;
The first one returning "123" (which I deem correct) while the second one returning "123 "def_79": [".
What's the issue at stake here? A bad regex or some weird functioning of Oracle? The regex seems to work well when tried against Sublime Text. I'm running this query directly off Oracle SQL Developer.
Thanks
.*abc[^:]*: *([^,]*),.*will help? You did not match the whole rest of the string after the comma.SELECT regexp_substr(' "abc_78": 123, "def_79": [', 'abc_[^:]*:\s*(\d+)', 1,1,NULL,1) from dual;