Do you have an Oracle function to anonimize emailadresses?

Situation

Email adresses in your database should be anonimized. 

There are different scenarios possible.

Oracle has the function REGEXP_REPLACE to change textstrings


Explanation

Replace EMAILFIELD by your own Input Email Field for this function.


Replace current input Email Domain by fixed domain (john.doe@example.com → john.doe@internaldomain.com )

REGEXP_REPLACE(<EMAILFIELD>,'@.*','@internaldomain.com')


Scramble input Email Name and use fixed domain: (john.doe@example.com → xxxx.xxx@internaldomain.com )

REGEXP_REPLACE(REGEXP_REPLACE(<EMAILVELD>,'([[:alnum:]]){1}', 'x'),'@.*','@internaldomain.com')


Randomize Input Email Name and keep domainname. (john.doe@example.com → rdlqszpo@example.com )

(Requires execute permission on dbms_random package)

REGEXP_REPLACE(<EMAILFIELD>,'.*@',dbms_random.string('l',length(REGEXP_REPLACE(<EMAILFIELD>,'@.*')))||'@')