Regular expression in oracle to match everything between parenthesis

Jaggu

example:

select * 
from emp 
where empid in (13,2,333,4) 
order by sal;

required output: 13,2,333,4

I want an regular expression that matches anything between "(" and ")".

Gordon Linoff

If you don't have newline characters, then this will work:

select regexp_substr(c, '\(.*\)')

This includes the parentheses as well as the contents. I would get rid of them with a simple replace:

select replace(replace(regexp_substr(c, '\(.*\)'), '(', ''), ')', '')

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Regular expression to match a string between parenthesis and comma, but with multiple parenthesis present

Match everything but Regular Expression

Match everything but numbers regular expression

Regular expression to return text between ( ) parenthesis

Regular expression to return text between parenthesis

Regular expression to match everything except two strings?

Regular expression match everything after newline

Regular expression: Match everything after a particular word

How to match everything but a regular expression with sed?

regular expression to match everything until the last occurrence of /

Regular expression to match everything, except HTML tags

regular expression affected by everything around it preventing a match

How do I match the contents of parenthesis in a scala regular expression

Match regular expression between delimiters

Regular expression with parenthesis in datatable

Match character if not between parenthesis

Regular Expression: Match everything except one specific character

How do I match angular brackets and everything inside with regular expression?

Oracle Regular Expression-To match exclude numbers

Oracle POSIX dosent match Regular Expression

Ignore blocks in parenthesis in regular expression

Regular Expression Not Matching Escaped Parenthesis

Regular expression for removing text with parenthesis

Regular expression match between string and last digit

Regular Expression Match between occurrence of character

Match text between two strings with regular expression

Regular Expression to match text between # and only if # is not preceded by '

Regular expression to match text between specific keywords

Regular Expression to remove everything but characters and numbers between Square brackets