Jump to content
UBot Underground

Recommended Posts

Ok so i am trying to make a bot that will go into gmail and scrape a set regex for example 

 

 

i have been trying to figure out the regex for this for the longest time today 

 

 

 

,"\u003cspan class\u003d\"yP\" email\u003d\"promotions@eprizepromotions.com\" name\u003d\"conagra@eprizepromotions.\"\u003econagra@eprizepromotions.\u003c/span\u003e","\u0026raquo;\u0026nbsp;","Your Snack Pack Code Request…","Here is your code to enter in the Snack Pack Instant Win and Sweepstakes: PD4P6YXP97WPRR76 Remember,",0,"","","9:10 am","Thu, Jan 2, 2014 at 9:10 AM",1388707668832000,,

 

 

 

 

and i need to Get the 16 Digit code string after Sweepstakes but having issues finding the regex for it 

 

I know i am noob at the never messed with regex before 

Link to post
Share on other sites

Here ya go!

 

^.{1,}Sweepstakes: (.{1,16}).{1,}

 

Now just use this code and you will see in action!

set(#var, "\"\\u003cspan class\\u003d\\\"yP\\\" email\\u003d\\\"promotions@eprizepromotions.com\\\" name\\u003d\\\"conagra@eprizepromotions.\\\"\\u003econagra@eprizepromotions.\\u003c/span\\u003e\",\"\\u0026raquo;\\u0026nbsp;\",\"Your Snack Pack Code Request…\",\"Here is your code to enter in the Snack Pack Instant Win and Sweepstakes: PD4P6YXP97WPRR76 Remember,\",0,\"\",\"\",\"9:10 am\",\"Thu, Jan 2, 2014 at 9:10 AM\"", "Global")
set(#var2, $replace regular expression(#var, "^.\{1,\}Sweepstakes: (.\{1,16\}).\{1,\}", "$1"), "Global")
ui stat monitor("16 character code", #var2)

Good Luck!

 

Buddy

Link to post
Share on other sites

didn't seem to work :(

 

 

Here is them email via copy and paste idk if that make a diff i used page source to get the text in the op 

 

 

 

 
i am just needing the 16 digit text code after Sweepstakes 

conagra@eprizepromotions.com promotions@eprizepromotions.com via bounce.eprizemail.com 
9:16 AM (9 hours ago)


to me 






Here is your code to enter in the Snack Pack Instant Win and Sweepstakes: 4RJPRJ4WYR6HR7G9


Remember, you can also find codes inside specially marked Snack Pack packages. You can enter 1 code per day, so that means you can come back each day of the promotion for even more chances to win!


Click Here to enter your code for a chance to win. 


Thank you and good luck! 


Snack Pack 




©ConAgra Foods. All Rights Reserved.
†MANY WILL ENTER, FEW WILL WIN. NO PURCHASE NECESSARY. A PURCHASE WILL NOT INCREASE YOUR CHANCES OF WINNING. LEGAL RESIDENTS OF THE 50 UNITED STATES (D.C.) AND PUERTO RICO 13 YEARS AND OLDER. VOID WHERE PROHIBITED. Promotion ends 4/30/14. For Official Rules, free method of entry, prize descriptions and odds disclosure, visit http://www.SnackPack.com/trip. Sponsor: ConAgra Foods, Inc. 215 W. Diehl Road, Naperville, IL 60563. © MARVEL. Shrek 4-D © 2014 DreamWorks Animation L.L.C. and Paramount Pictures Corporation. All Rights Reserved. Universal elements and all related indicia TM & © 2014 Universal Studios. All rights reserved.
Edited by Team_LX
Link to post
Share on other sites

I only used the code that you provided in your initial post.  Let me check this whole email.

 

Buddy

yea was not sure if you needed the source or the email i am trying to get an over all regex code that works to get that 16 digit code

Link to post
Share on other sites

You may have to load this email's content as sentences and then process each item with the regex code I gave you.  For some reason my browser regex tool is not working. 

 

Buddy

Link to post
Share on other sites

Okay.  Try this

set(#var, "


conagra@eprizepromotions.com promotions@eprizepromotions.com via bounce.eprizemail.com 
9:16 AM (9 hours ago)


to me 






Here is your code to enter in the Snack Pack Instant Win and Sweepstakes: 4RJPRJ4WYR6HR7G9


Remember, you can also find codes inside specially marked Snack Pack packages. You can enter 1 code per day, so that means you can come back each day of the promotion for even more chances to win!


Click Here to enter your code for a chance to win. 


Thank you and good luck! 


Snack Pack 




©ConAgra Foods. All Rights Reserved.
†MANY WILL ENTER, FEW WILL WIN. NO PURCHASE NECESSARY. A PURCHASE WILL NOT INCREASE YOUR CHANCES OF WINNING. LEGAL RESIDENTS OF THE 50 UNITED STATES (D.C.) AND PUERTO RICO 13 YEARS AND OLDER. VOID WHERE PROHIBITED. Promotion ends 4/30/14. For Official Rules, free method of entry, prize descriptions and odds disclosure, visit http://www.SnackPack.com/trip. Sponsor: ConAgra Foods, Inc. 215 W. Diehl Road, Naperville, IL 60563. © MARVEL. Shrek 4-D © 2014 DreamWorks Animation L.L.C. and Paramount Pictures Corporation. All Rights Reserved. Universal elements and all related indicia TM & © 2014 Universal Studios. All rights reserved.

", "Global")
clear list(%list1)
add list to list(%list1, $list from text(#var, "
"), "Delete", "Global")
set(#var2, $replace regular expression($list item(%list1, 3), "^.\{1,\}Sweepstakes: (.\{1,16\}).\{1,\}", "$1"), "Global")
ui stat monitor("16 character code", #var2)
set(#var, "", "Global")

This still works for me.  Of course you would need to tweak it for your bot.

 

Buddy

Link to post
Share on other sites

Try this for first example

 

(?<=Sweepstakes: ).*?(?= Remember,)

 

This for 2nd example

 

(?<=Sweepstakes: ).*

 

test it here

 

http://regexhero.net/tester/

 

it may be better to get that line into a variable  and replace everything except what you want on that line with nothing.

 

something like this

 

set(#code$replace("Here is your code to enter in the Snack Pack Instant Win and Sweepstakes: 4RJPRJ4WYR6HR7G9""Here is your code to enter in the Snack Pack Instant Win and Sweepstakes: "$nothing), "Global")

 

TC

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

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