I'm struggling with this one in Oracle.

I want everything between "Command (" and ") executed by "

String:

> 
> Command (grep ) ex.txt) executed by user1@server03 as root@server03
> 
> 
> 

Desired result:

> 
> grep \) ex.txt
> 
> 
> 

I'm testing de regex on this site: <https://regex101.com>

This solution work on the site but, do not in my select:

> 
> (?<=Command ()(.*?)(?=\e*))
> 
> 
> 

Select used:

> 
> select
>  REGEXP\_SUBSTR(MSG,'(?<=Command ()(.*?)(?=\e*))',1) as command
>  from COMMANDS
> 
> 
> 

The expression **(([^)]+))** works, except when there is a other ")" inside the string. That's why I'm trying the between strings approach instead of just inside parentheses.

Thanks a lot