Bill Brine 0 Posted July 27, 2013 Report Share Posted July 27, 2013 I'm trying to extract a particular URL from an email body. These are text emails, not HTML. I've extracted the email to a table, and assigned column 4 (the body) to a variable. Here's the part of the email I am interested in: http://www.whatstuff.co.uk?advertiseGrab Your Credits Here:http://www.safelists.com/lists.php?r=xjqgfvx19tsw7yui4vqy&u=jwbrine&sb=whatstuffSee our other mailer: http://www.wondermailer.com/whatstuffWe are not responsible for any claims by this advertiser.To ex-punge your account, please login to do so. Hitting reply will not go to a live person. 07-27-2013 whatstuff - hooklistadv midnight pass brownsburg in 46112 I want to extract the URL that follows Grab Your Credits here. The part that comes after /lists.php=? will be different for each email. So i've set a variable up to do a regex on the email body. Here's the regex I have been trying: http:\/\/www\.safelists\.com\/lists\.php.* also tried http:\/\/www\.safelists\.com\/lists\.php.*\s These work when I test them in regex testers that I have. However in Ubot the assigned variable is always blank. What am I doing wrong? Does the fact that the email body contains CRs and LFs affect this perhaps? Quote Link to post Share on other sites
UBotDev 276 Posted July 27, 2013 Report Share Posted July 27, 2013 I think you use wrong REGEX pattern. This should work: set(#URL, $find regular expression(" http://www.whatstuff.co.uk?advertise Grab Your Credits Here: http://www.safelists.com/lists.php?r=xjqgfvx19tsw7yui4vqy&u=jwbrine&sb=whatstuff See our other mailer: http://www.wondermailer.com/whatstuff We are not responsible for any claims by this advertiser. To ex-punge your account, please login to do so. Hitting reply will not go to a live person. 07-27-2013 whatstuff - hooklist adv midnight pass brownsburg in 46112 ", "http://www\\.safelists\\.com/lists\\.php\\?.*"), "Global") Quote Link to post Share on other sites
Bill Brine 0 Posted July 29, 2013 Author Report Share Posted July 29, 2013 Thanks for the reply, that did not work but this did: http:\/\/www\.safelists\.com\/lists\.php\?.* Quote Link to post Share on other sites
UBotDev 276 Posted July 29, 2013 Report Share Posted July 29, 2013 Thanks for the reply, that did not work but this did: http:\/\/www\.safelists\.com\/lists\.php\?.*Well, if you copy the code to UBot it should work, since it still does here. Also, according to .NET REGEX reference you don't need to escape slashes. Quote Link to post Share on other sites
Bill Brine 0 Posted July 29, 2013 Author Report Share Posted July 29, 2013 I did copy your code to Ubot, it did not work. Anyway it works now with my code, so I'm happy. Quote Link to post Share on other sites
luis carlos 94 Posted August 10, 2013 Report Share Posted August 10, 2013 since he has the std version cant copy scripts. But Ubotdev, your code works great. Thks Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 10, 2013 Report Share Posted August 10, 2013 Since it is only one node I think it will work if you copy the code and then try to paste it as a node. 1 Quote Link to post Share on other sites
UBotDev 276 Posted August 10, 2013 Report Share Posted August 10, 2013 since he has the std version cant copy scripts. But Ubotdev, your code works great. ThksNice to know that I am not the only one, for who this work. ...and no problem.Since it is only one node I think it will work if you copy the code and then try to paste it as a node.I also think one node should work (it works in DEV in "node view") but don't have STD version to test that out. 1 Quote Link to post Share on other sites
Bill Brine 0 Posted August 17, 2013 Author Report Share Posted August 17, 2013 Thanks for the guidance, now I have a related question. As noted above, I only have STD version, however I can read the code you provide. Still working with the same pattern, but now I want to provide the regexp as a variable to the $find regular expression function. When I assign a regexp like http://abc\.com/whatever\.php\?.* to a variable and then supply that variable to the $find regular expression function, it does not find the pattern. If I supply the pattern directly to the $find regular expression function, it finds the pattern. I tried setting the variable to http://abc\\.com/whatever\\.php\\?.* seeing as you used double escape in your code above, but that did not help. What am I missing? 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.