I have a string 'hello big world,' and I want to remove 'big world' so that the end result string would be just 'hello,'. I didn't know that It would be that hard. The closest I got was:
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;
/