Skip to content
Advertisement

remove the first two part of delimited string

I have a string with delimiter ‘_’, example below

‘AAA_BBB_CCC_DDD_EEE’

I want to trim the first two elements of delimited string. Expected output:

‘CCC_DDD_EEE’

Advertisement

Answer

You should be able to use regexp_substr():

select regexp_substr(string, '^[^_]+_[^_]+_(.*)$', 1, 1, 'e')

Or regexp_replace():

select regexp_replace(string, ''^[^_]+_[^_]+_', '')
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement