I am trying to write a regular expression in regexp_substr()
.
For example, I have a string DA.*BLK
and I want to extract whatever between A
and B
. What I am doing now is to use
replace(replace(regexp_substr(target_column,'A.*B'),'A',''),'B','')`
Then I get whatever is in between.
But I think this way may not be efficient and it's not elegant. I also tried to use ?=
in there but it seems Oracle does not support such clause.
Could any one please let me know a better way to achieve my purpose? Thank you very much!