I need to check if the first 2 character of a string match with '00' or '01' or '02 and replace with '24' or '25' or '26' respectively.
So for example replace
'02:00:00' with '26:00:00'
I try:
SELECT replace(replace(replace('01:01:00'::varchar, '00:', '24:'),'01:', '25:'), '02:', '26:')
doesn't work because it returns:
"25:25:00"
I want match condition only for the first 2 character:
"25:01:00"
Maybe regexp_replace is the right way but I cannot find a solution.