eredmithrin 0 Posted May 18, 2013 Report Share Posted May 18, 2013 Hi, I'm having a bot that connects to predefined mailboxes, checks for unprocessed emails and if any, starts opening them one by one and replying to them. I'd like to insert a condition that would force my bot to reply only to emails that come from predefined domains. Other emails would be deleted. The problem I'm facing is that I scrape sender's email (someone@domain.com), but don't know how to effectively extract only the domain name (domain.com). And then how to compare this domain name with the list of predefined domain names. I'm sure this is really easy task to do and the only reason I'm stuck is that I lack some information/experience. Can anyone of you please share with me the direction I could take? I'd greatly appreciate it. Quote Link to post Share on other sites
VaultBoss 310 Posted May 18, 2013 Report Share Posted May 18, 2013 regex Quote Link to post Share on other sites
VaultBoss 310 Posted May 18, 2013 Report Share Posted May 18, 2013 Use a replace applied to the text/list item/table cell where you store each scraped email, using this regex: .*@ and replace with $nothing. You'll be left with only what you need/want. 1 Quote Link to post Share on other sites
eredmithrin 0 Posted May 20, 2013 Author Report Share Posted May 20, 2013 Use a replace applied to the text/list item/table cell where you store each scraped email, using this regex: .*@ and replace with $nothing. You'll be left with only what you need/want. thank you very much, it works like a charm! i knew it would be really easy Quote Link to post Share on other sites
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.