I am trying to cleanup some text. To achieve that, I came up with following query
Select message,
Case
when REGEXP_Count(message, 'Refreshing|update|create', 1, 'i') > 0 then REGEXP_REPLACE(message, 'Refreshing|Update|create', 'Edited',1, 1, 'i')
when REGEXP_Count(message, 'Open|View', 1, 'i') > 0 then REGEXP_REPLACE(message, 'Open|View', 'Viewed',1, 1, 'i')
else message
end
From audit_log al
Is there a better way to handle such replacement so I do not have to repeat REGEXP function twice? I'll need to handle approx 50 different replacements