5

I am attempting to uppercase the replacement string from my reg expression without success:

SELECT regexp_replace('src=/i/uie_v2/js','(/uie_v2/)',upper('\1')) from dual

returns 'src=/i/uie_v2/js'

I understand that upper cannot be used .. just showing as an example. Any ideas on how to achieve this ?

1 Answer 1

4

AFAIK, you cannot do this directly, but you can take the string apart and rebuild it:

SELECT regexp_replace('src=/i/uie_v2/js','(.*)(/uie_v2/)(.*)', '\1') ||
  upper(regexp_substr('src=/i/uie_v2/js','(/uie_v2/)')) || 
  regexp_replace('src=/i/uie_v2/js','(.*)(/uie_v2/)(.*)', '\3')
from dual

I got the idea from an OTN forums thread on REGEXP.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.