I'd like to extract the package name using regexp_substr.
For example:
create or replace package body something.pkg_test is
I want that:
pkg_test
I tried to use lookbehind just to ignore "create or replace package body something.":
select regexp_substr('create or replace package body something.pkg_test is','((?<!create\sor\sreplace\spackage\sbody\ssomething\.).)*$',1,1) from dual;
But it doesn’t work. So I just need to extract the package name between "create or replace package body something" and the first space or \n.
I need that because I want the package name before compile a .sql file and insert it in a table.