I am using cakephp. And I have textarea field where users paste data, I using tinymce plugin to format text. I have warned users not to enter telephone number or email address inside the textarea. But, I dont want to take chances.
Is there a way I can extract the telephone number and email from textarea and replace it something like XXXX@gmail.com..
I appreciate any help.
Thanks.
Here’s something off the top of my head for replacing the e-mail address with hidden:
The e-mail regex is not the best, but it’s something that works for your example. You can get more interesting regexes (emails and phone numbers) at http://www.regexlib.com/ and use them with a simple preg_replace.