How to extract group from regular expression in Oracle?

后端 未结 2 1615
甜味超标
甜味超标 2020-11-28 06:37

I got this query and want to extract the value between the brackets.

select de_desc, regexp_substr(de_desc, \'\\[(.+)\\]\', 1)
from DATABASE
where col_name l         


        
2条回答
  •  我在风中等你
    2020-11-28 07:18

    You need to do a replace and use a regex pattern that matches the whole string.

    select regexp_replace(de_desc, '.*\[(.+)\].*', '\1') from DATABASE;
    

提交回复
热议问题