Jump to content
UBot Underground

Recommended Posts

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?

 

 

Link to post
Share on other sites

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")

Link to post
Share on other sites

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.

Link to post
Share on other sites
  • 2 weeks later...

since he has the std version cant copy scripts.  But Ubotdev, your code works great.  Thks

Nice 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.

  • Like 1
Link to post
Share on other sites

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? 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...