Answer the question
In order to leave comments, you need to log in
Replace part of a string between two characters?
Good time!
Can you please tell me how to replace part of a string between two characters?
for example:
DGN-04-13601/21-53 you need to get DGN-04-********/21-53
instead of asterisks there will be a variable text.
Answer the question
In order to leave comments, you need to log in
Here are a couple of examples
--С помощью регулярного выражения
select REGEXP_REPLACE('ДГН-04-13601/21-53', '-\d{1,}/', '-********/') from dual;
--Если строка всегда одной длины, то можно с помощью substr
select substr('ДГН-04-13601/21-53', 0, 7) || '********' || substr('ДГН-04-13601/21-53', 13) from dual;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question