I need to find all the email addresses and the urls that are in a document and modify them using php code. For example, for the email addresses: it is name.surname@yahoo.co.uk.com I have to modify it to name_s@hotmail.co.uk. For the urls I have to transform the domain For example: it is www.yahoo.co.uk to www.hotmail.co.uk . Could you please help me?

P.s Sorry for my english.