Tormiasz Posted September 28, 2013 Posted September 28, 2013 (edited) Hello. I am getting the whole site by InetRead and BinaryToString functions and I want to get the array of ALL the words that are maching this url <a href="http://www.asd.com/abc/?new=yaya&xyz=Name>Name</a> I want to get the "Name"'s into array. Can anyone help me? Edited September 28, 2013 by Tormiasz
FireFox Posted September 28, 2013 Posted September 28, 2013 (edited) Hi,#include <Array.au3> $s = 'href="http://www.asd.com/abc/?new=yaya&xyz=Name">Name</a>' $a = StringRegExp($s, '(?m)href="http://www.asd.com/abc/\?new=yaya&xyz=Name">(.*?)</a>', 3) _ArrayDisplay($a)Edit: If "Name" is always a word then replace (.*?) by (w+), if it can have spaces then ([ws]+)Br, FireFox. Edited September 28, 2013 by FireFox
Tormiasz Posted September 28, 2013 Author Posted September 28, 2013 Someting is wrong for example There will be Two lines (names are generated randomly) <a href="http://www.asd.com/abc/?new=yaya&xyz=First Name>First Name</a> <a href="http://www.asd.com/abc/?new=yaya&xyz=Second Name>Second Name</a> Your method is not working properly for me. IDK why.
FireFox Posted September 28, 2013 Posted September 28, 2013 If the word to search is the same in the end of the url as in the a value then:#include <Array.au3> $sWord = "toto" $s = 'href="http://www.asd.com/abc/?new=yaya&xyz=' & $sWord & '">' & $sWord & '</a>' $a = StringRegExp($s, '(?m)href="http://www.asd.com/abc/\?new=yaya&xyz=(.*?)">', 3) _ArrayDisplay($a)Br, FireFox.
mrflibblehat Posted September 28, 2013 Posted September 28, 2013 Im not great with regexp but the below works for me. #include <Array.au3> $vSource = 'href="http://www.asd.com/abc/?new=yaya&xyz=Name">Name</a>href="http://www.asd.com/abc/?new=yaya&xyz=First Name">First Name</a>href="http://www.asd.com/abc/?new=yaya&xyz=Second Name">Second Name</a>' $vRegExp = StringRegExp($vSource, 'href="http://www.asd.com/abc/\?new=yaya&xyz=.*?">(.*?)</a>', 3) _ArrayDisplay($vRegExp) [font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]
Tormiasz Posted September 28, 2013 Author Posted September 28, 2013 $a = StringRegExp($s, '(?m)href="http://www.asd.com/abc/\?new=yaya&xyz=(.*?)"?m)', 3) This one works well. Thank you for the help.
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