Answer the question
In order to leave comments, you need to log in
What is the best way to optimize a regular expression?
Hello.
Today I had to solve a problem with a regular expression in PL-SQL
, for example, from
select 'SESSION_WAIT' as name, (select UM.MON_SESSION_WAIT from dual) as value from DUAL , I decided to
pull out SESSION_WAIT
in this way
SELECT
SUBSTR(REGEXP_SUBSTR('select ''SESSION_WAIT'' as name, (select UM.MON_SESSION_WAIT from dual) as value from DUAL', '''[^'']+'''),2,LENGTH(REGEXP_SUBSTR('select ''SESSION_WAIT'' as name, (select UM.MON_SESSION_WAIT from dual) as value from DUAL', '''[^'']+'''))-2)
FROM DUAL
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question