Jump to content

[SOLVED] Regex for getting rid of emails also removing URLs...


nevynev

Recommended Posts

Hi there,

 

I have the following regex for picking up emails which works fine but I just found out it also removes URLs (e.g. www.google.com). How do I retain its ability to pick up all kinds of email addresses but ignore domain names?

 

It is:

 

/\b[A-Z0-9._%+-]+\s?(@|#|at)\s?[A-Z0-9.-]+\s?\.\s?[A-Z]{2,4}\b/si

 

Thanks

NevyNev

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.