Tempest Posted August 4, 2008 Share Posted August 4, 2008 Hey everybody,How can I extract a URL from an email? I tried using StringRegExp and some other stuff, but I couldn't really get it.. :/I tried using StringMid to step through to get it..but that doesn't really work either, since I can't always know where the characters are gonna start.So my question is, knowing the beginning and end of the URL...can I somehow extract just the bit I need? Like;http://www.something.com/blah.php?var=9023...71947&end=0I could put "?var=" and "&end=0" into a function and get a string equal to the stuff inbetween?Thanks. :< Link to comment Share on other sites More sharing options...
Tempest Posted August 4, 2008 Author Share Posted August 4, 2008 Ok I got it working, kind of, using a combination of string functions, only problem is, it has '&' instead of '&' :S How can I fix that? Link to comment Share on other sites More sharing options...
Valuater Posted August 4, 2008 Share Posted August 4, 2008 StringReplace() 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 4, 2008 Moderators Share Posted August 4, 2008 Ok I got it working, kind of, using a combination of string functions, only problem is, it has '&' instead of '&' :S How can I fix that?You say you "tried", but you show no "efforts"?#include <array.au3> $s_url = "http://www.something.com/blah.php?var=90234832094823094723054719471947&end=0" $a_regex = StringRegExp($s_url, "(?i)(http.+?var=.+?end=.*?)", 3) _ArrayDisplay($a_regex) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Tempest Posted August 4, 2008 Author Share Posted August 4, 2008 Thank you guys very much it's working now. )) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now