d0n Posted November 29, 2009 Share Posted November 29, 2009 i am trying to get a pattern attachment.php?aid=787795&k=ed6f1934ea92a037f4bbd102b7c80db9&t=1259460253&fid=8&sid=37f8lAaodEqWbOSkKY5XoH4xt5BqvMruZfXtDM5Wp%2BekDUE in this line <a href="attachment.php?aid=787795&k=ed6f1934ea92a037f4bbd102b7c80db9&t=1259460253&fid=8&sid=37f8lAaodEqWbOSkKY5XoH4xt5BqvMruZfXtDM5Wp%2BekDUE" onmouseover="showMenu(this.id,false,2)" id="aid787795" target="_blank" title="">Show Ch01.torrent</a> (17.98 KB) I have this but it doesn't seem to be getting the stuff in the bracket $Link = StringRegExp($HTML, '.*?<a href="(.*?)".*?Show Ch01.torrent</a>.*?', 1) Theres a bunch of crap before and after it, but i am not sure what is wrong Link to comment Share on other sites More sharing options...
dantay9 Posted November 29, 2009 Share Posted November 29, 2009 Can you use _StringBetween? That would be much easier. Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 29, 2009 Share Posted November 29, 2009 (edited) $Links = StringRegExp($HTML, '<a href="([^"]*)"[^>]*>Show Ch01.torrent</a>', 1) $Link = $Links[0] Try this. If the 0 index isn't right, try the 1 index ($Links[1] instead). Edited November 29, 2009 by Richard Robertson Link to comment Share on other sites More sharing options...
d0n Posted November 29, 2009 Author Share Posted November 29, 2009 um because in the website's html, there is way more than 1 '<a href="' beginning of string to use _StringBetween Link to comment Share on other sites More sharing options...
d0n Posted November 29, 2009 Author Share Posted November 29, 2009 $Links = StringRegExp($HTML, '<a href="([^"]*)"[^>]*>Show Ch01.torrent</a>', 1) $Link = $Links[0] Try this. If the 0 index isn't right, try the 1 index ($Links[1] instead). Tried that just now, @error returns 1 Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 This works for me $Link = StringRegExp($HTML, "(?i)<a\shref[\s=]+[\x22\x29](.+?)[\x22\x29]", 1) George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
d0n Posted November 29, 2009 Author Share Posted November 29, 2009 (edited) can i ask what \x22\x29 is? do they equal " ? because using this is giving me HTML codes from before this line Edited November 29, 2009 by d0n Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 can i ask what \x22\x29 is? do they equal " ?because using this is giving me HTML codes from before this line\x22 = double quote\x29 = single quoteIf you are getting other lines before that then we will have to see a bit more of the html code to get the right link unless there is something in that link that is specific and never changes. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
d0n Posted November 29, 2009 Author Share Posted November 29, 2009 <a href="attachment.php?aid=787795&k=ed6f1934ea92a037f4bbd102b7c80db9&t=1259460253&fid=8&sid=37f8lAaodEqWbOSkKY5XoH4xt5BqvMruZfXtDM5Wp%2BekDUE" onmouseover="showMenu(this.id,false,2)" id="aid787795" target="_blank" title="">Show Ch01.torrent</a> This doesn't change <a href=" onmouseover="showMenu(this.id,false,2)" target="_blank" title="">Show Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 <a href="attachment.php?aid=787795&k=ed6f1934ea92a037f4bbd102b7c80db9&t=1259460253&fid=8&sid=37f8lAaodEqWbOSkKY5XoH4xt5BqvMruZfXtDM5Wp%2BekDUE" onmouseover="showMenu(this.id,false,2)" id="aid787795" target="_blank" title="">Show Ch01.torrent</a> This doesn't change <a href=" onmouseover="showMenu(this.id,false,2)" target="_blank" title="">Show Those are also most likely common to all the links on the page too so they won't help. Can you provide a link to the page you are trying to read? George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
d0n Posted November 29, 2009 Author Share Posted November 29, 2009 sorry i think i forgot to mention that there is only 1 'Show Ch01.torrent' in the source of the site that is why i tried something like this in the beginning but failed $Link = StringRegExp($HTML, '.*?<a href="(.*?)".*?Show Ch01.torrent</a>.*?', 1) Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 sorry i think i forgot to mention that there is only 1 'Show Ch01.torrent' in the source of the site that is why i tried something like this in the beginning but failed $Link = StringRegExp($HTML, '.*?<a href="(.*?)".*?Show Ch01.torrent</a>.*?', 1) "(?i)<a\shref[\s=]+[\x22\x29](.+?)[\x22\x29].+Show\s*Ch01\.torrent" George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 Actually that last one should be "(?i)<a\shref[\s=]+[\x22\x29]*(.+?)[\x22\x29\s].+Show Ch01.torrent" George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
d0n Posted November 29, 2009 Author Share Posted November 29, 2009 (edited) that one returns @error = 1 :S EDIT: nvm got it, had an extra space thank you for the help Edited November 29, 2009 by d0n Link to comment Share on other sites More sharing options...
GEOSoft Posted November 29, 2009 Share Posted November 29, 2009 I just tested this and it works for me $Link = StringRegExp($HTML, "(?i)<a\shref[\s=]+[\x22\x29]*(.+?)[\x22\x29\s].+Show\s*Ch01.torrent", 1) George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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