Para substituir uma string fixa, use o simples
replace() função. Para substituir uma string dinâmica, você pode usar
regexp_replace() assim:UPDATE
YourTable
SET
TheColumn = regexp_replace(
TheColumn, 'https://[^:\s]+:9999(\S+)', 'https://example2.com\1', 'g'
)