nevynev Posted September 26, 2007 Share Posted September 26, 2007 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 Link to comment https://forums.phpfreaks.com/topic/70740-solved-regex-for-getting-rid-of-emails-also-removing-urls/ Share on other sites More sharing options...
effigy Posted September 26, 2007 Share Posted September 26, 2007 at is the culprit; try \bat\b. Link to comment https://forums.phpfreaks.com/topic/70740-solved-regex-for-getting-rid-of-emails-also-removing-urls/#findComment-355701 Share on other sites More sharing options...
nevynev Posted September 26, 2007 Author Share Posted September 26, 2007 Thanks! Link to comment https://forums.phpfreaks.com/topic/70740-solved-regex-for-getting-rid-of-emails-also-removing-urls/#findComment-355711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.