Jump to content
UBot Underground

Trying to grab username from email-table using Regex


Recommended Posts

Hello People,

I am a newbie with ubot and regex.

I am trying to grab username from emails..

 

 

Here is the email in table

Column 4:
your username is:

   Banana123

visit this link to verify your email address:

http://example.com/verify/qw123t

thanks for using our website!




 

Below is my code:-

connect to mail server("POP3", "mail@example.org", "pass123", "mail.example.org", 110) {
create table from emails(&allemails)
}

add list to list(%username, $find regular expression(&allemails, "(?<=your\\susername\\sis:\\n\\n\\s\\s\\s\\s).*?(?=\\n\\nvisit\\sthis\\slink\\sto\\sverify\\syour\\semail\\saddress)"), "Delete", "Global")

 

Regular expression code:

 

(?<=your\susername\sis:\n\n\s\s\s\s).*?(?=\n\nvisit\sthis\slink\sto\sverify\syour\semail\saddress:)

 

Whenever i run the script, i see nothing in %username list..

I am trying to grab "Banana123" in the list.

 

Please help me out..

Link to post
Share on other sites

Try this:

 

set(#email, "Banana123@gmail.com", "Global")
set(#nick, $replace regular expression(#email, "(@.*)", $nothing), "Global")

 

^^^ That is just an example (you'll need to loop through your list of emails and replace one by one)

  • Like 2
Link to post
Share on other sites

Try this:

 

set(#email, "Banana123@gmail.com", "Global")
set(#nick, $replace regular expression(#email, "(@.*)", $nothing), "Global")

 

^^^ That is just an example (you'll need to loop through your list of emails and replace one by one)

Hello,

Thanks for the code..

However,I am not looking to grab the word before @example.com

I am looking to grab the word "Banana123" from the table cells.

your username is:
   Banana123
visit this link to verify your email address:

 

The username is auto-generated from site and gets different from email..

 

However, you gave me an idea for another bot.. :)

 

My problem is still not solved.. looking for a solution..

Link to post
Share on other sites

two nodes no regex needed

 

add list to list(%test, $list from text("your username is:
 Banana123
visit this link to verify your email address:
http://example.com/verify/qw123t
thanks for using our website!
", $new line), "Delete", "Global")
set(#email, $list item(%test, 1), "Global")

 

i of course pasted text in you will have a table cell in there

 

pftg4

  • Like 2
Link to post
Share on other sites

two nodes no regex needed

 

add list to list(%test, $list from text("your username is:
 Banana123
visit this link to verify your email address:
http://example.com/verify/qw123t
thanks for using our website!
", $new line), "Delete", "Global")
set(#email, $list item(%test, 1), "Global")

 

i of course pasted text in you will have a table cell in there

 

pftg4

That is awesome !

Solved my problem

 

Thanks a lot.. :D

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