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 Quote 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. Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.