Jump to content



Photo

Using Regex To Get Url From Line In Table


  • Please log in to reply
4 replies to this topic

#1 quickregister

quickregister

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Standard Edition

Posted 05 January 2018 - 07:50 PM

I am trying to get the url from this line in a table I have saved. Here is the line I want the url from:

Please validate your registration by clicking on the following link: <a href=""http://www.bestinjurylawyerusa.com/classifieds/user/activate/11/Ha9XdOM8"">

I want everything after :

Please validate your registration by clicking on the following link: <a href=""

and everything before:

"" >

 

To give me:

http://www.bestinjurylawyerusa.com/classifieds/user/activate/11/Ha9XdOM8

I used the Regex Builder 2.0 to get this regex code

 

(?<=" >)(?=Please\ validate\ your\ registration\ by\ clicking\ on\ the\ following\ link\:\ \<a\ href\=\"\")

 

However, I do not get anything when I run this code:

clear list(%verification emails)
    set(#temp row, 0, "Global")
    loop($table total rows(&emails)) {
        add item to list(%verification emails, $find regular expression($list from text($table cell(&emails, #temp row, 5), $new line), "(?<=\" >)(?=Please\\ validate\\ your\\ registration\\ by\\ clicking\\ on\\ the\\ following\\ link\\:\\ \\<a\\ href\\=\\\"\\\")"), "Delete", "Global")
        increment(#temp row)

Anybody have an idea what I am missing? 

 

When I use http://*/user/activate/*/* as the regex expression it does give me the url in this format

http://www.bestinjurylawyerusa.com/classifieds/user/activate/11/Ha9XdOM8">http://www.bestinjurylawyerusa.com/classifieds/user/activate/

Not sure how to get rid of the:

" >http://www.bestinjurylawyerusa.com/classifieds/user/activate/

Any help would be appreciated.  Thank you!


Edited by quickregister, 05 January 2018 - 07:52 PM.


#2 pash

pash

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3161 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 05 January 2018 - 08:50 PM

Try


alert($find regular expression("Please validate your registration by clicking on the following link: <a href=\"http://www.bestinjurylawyerusa.com/classifieds/user/activate/11/Ha9XdOM8\">","(?<=href=\").*?(?=\")"))

New Plugin:: Advanced Facebook | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint
- Advanced Data Text File | Advanced DateTime | Advanced Dialog | Advanced Document | Advanced Google Blogger V3 | Advanced Google Drive | Advanced Google YouTube V3 | Advanced Image | Advanced Video | Advanced Screen and Windows | Advanced Systems | Advanced Ubot 1 | Advanced Ubot 2 | Advanced WordPress | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint

- Advanced Captcha (V3) | Advanced Captcha (V2) (Old) | Create Table From Excel (Lite) | Check Conection | Ubot Enter License | Auto Free Memory
- Working hours GMT+7. i regret sometimes the answer is delayed due to health problems.


#3 quickregister

quickregister

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Standard Edition

Posted 06 January 2018 - 06:43 AM

Thank you very much for your help Pash. I will work on this.



#4 quickregister

quickregister

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Standard Edition

Posted 06 January 2018 - 08:11 AM

That worked for the text I gave you however actually I need to extract from this text:

<html><head></head><body><p>Hi Matt,</p><p>Please validate your registration by clicking on the following link: <a href="http://www.bestinjurylawyerusa.com/classifieds/user/activate/12/97OZ8FEq">http://www.bestinjurylawyerusa.com/classifieds/user/activate/12/97OZ8FEq</a></p><p>Thank you!</p><p>Regards,</p><p><a href="http://www.bestinjurylawyerusa.com/classifieds/">Bestinjurylawyerusa Free Classifieds</a></p>

</body></html>

When I use:

(?<=href=").*?(?=")

I get:

 

http://www.bestinjurylawyerusa.com/classifieds/user/activate/12/97OZ8FEq
http://www.bestinjurylawyerusa.com/classifieds/

I need:

http://www.bestinjurylawyerusa.com/classifieds/user/activate/12/97OZ8FEq

I have tried using regex builder 2.0 to give me everything 

after link: <a href=" and before </a>

It gives me this: 

(?<=\<\/a\>).(?=link\:\ \<a\ href\=\")

Which does not produce any results. Any ideas? Thank you.



#5 quickregister

quickregister

    Advanced Member

  • Members
  • PipPipPip
  • 39 posts
  • OS:Windows 8
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Standard Edition

Posted 06 January 2018 - 09:14 AM

Figured it out. This worked.

(?<= link: <a href=").*?(?=")





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users