Restrict user to share Phone and Email over the message

Is there any code snippet to restrict user to share Email or Phone number in messages in order to restrict the vendor and user direct connection ?

A post was merged into an existing topic: Best way to block email in messages