Jump to content
UBot Underground

Using Regex To Get Url From Line In Table


Recommended Posts

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
Link to post
Share on other sites

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=\").*?(?=\")"))
Link to post
Share on other sites

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.

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