0

I have a procedure that is actually making a replace of '#$#' by '', the value that contains '#$#' it could be, like this one: 'AAA#$#DEFAEFGAA', with no defined length.

But what is really needed is to take only the characters after #$#, 'DEFAEFGAA'.

Thanks a lot in advance to those who take the time to read and trying to help me. Regards

I have tried to use replace regexp_replace to replace whatever is found from the beginning until the second '#' by '' but I can't find the right combination of commands like "(?=[^ ][a-z])(?=[^ ][0-9])[^ ]+'"

and I am also trying to use regexp_substr to take only the characters after #$# in case they appear or not.

1 Answer 1

0

You can use charindex and substring instead of rexeg

with temp as (select 'AAA#$#DEFAEFGAA'::text as str)
select substring(str, charindex('#$#', str) + 3) as substr
from temp;

return 'DEFAEFGAA'

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.