【发布时间】:2019-02-01 10:44:30
【问题描述】:
我有一个字符串'hello big world',我想删除'big world',这样最终结果字符串就只是'hello'。我不知道会这么难。我得到的最接近的是:
declare
l_string varchar2(40);
begin
l_string := 'hello big world,';
dbms_output.put_line(l_string);
l_string := regexp_replace(l_string, 'hello (.*),$', '\1');
dbms_output.put_line(l_string); -- it returns 'big world' and that's the part I want to remove
end;
/
【问题讨论】:
标签: regex oracle regexp-replace