noname 2 Posted May 1, 2015 Report Share Posted May 1, 2015 im trying to get this value AQEleUVnsmgo name="sebg" value="AQEleUVnsmgo" autocomplete="off"> i have no problem getting the regex value but there is 3 instances on the page and i just want one here is what i have (?<=sebg\"\ value\=\").+?(?=\"\ autocomplete\=) and it outputs this AQEleUVnsmgoAQEleUVnsmgoAQEleUVnsmgo and the out put i want is AQEleUVnsmgo Quote Link to post Share on other sites
pftg4 102 Posted May 2, 2015 Report Share Posted May 2, 2015 just add to list and pick first one Quote Link to post Share on other sites
noname 2 Posted May 2, 2015 Author Report Share Posted May 2, 2015 when i try to add it to list it adds all as one line Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 2, 2015 Report Share Posted May 2, 2015 when i try to add it to list it adds all as one line That is really weird, can you post the full page you're trying to work with as your regex looks alright and what pftg4 said should work fine for this. Quote Link to post Share on other sites
noname 2 Posted May 2, 2015 Author Report Share Posted May 2, 2015 the reason it outputs 3 is because that string is on the page 3 times Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 2, 2015 Report Share Posted May 2, 2015 the reason it outputs 3 is because that string is on the page 3 times Right but that regex should add it to the list 3 times and then if it removes duplicates you will have your output in the list item 0, check this out: set(#var, "name=\"sebg\" value=\"AQEleUVnsmgo\" autocomplete=\"off\"> name=\"sebg\" value=\"AQEleUVnsmgo\" autocomplete=\"off\"> name=\"sebg\" value=\"AQEleUVnsmgo\" autocomplete=\"off\">", "Global") clear list(%regex) add list to list(%regex, $find regular expression(#var, "(?<=sebg\\\"\\ value\\=\\\").+?(?=\\\"\\ autocomplete\\=)"), "Delete", "Global") Maybe that can give you some insight. But otherwise if you post the string you're trying to find the regex in I can show you directly with that as well. Quote Link to post Share on other sites
noname 2 Posted May 2, 2015 Author Report Share Posted May 2, 2015 http://facebook.com add item to list(%testlist,$find regular expression(#FriendsPage_one,"(?<=name\\=\\\"fb_dtsg\\\"\\ value\\=\\\").+?(?=\\\"\\ autocomplete\\=)"),"Delete","Global") AQHIwAIKqnSKAQHIwAIKqnSKAQHIwAIKqnSK thats what gets put in my list as line zero Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 2, 2015 Report Share Posted May 2, 2015 The reason being: you're adding an item to a list. In this case you want to use add list to list, try this: clear list(%testlist) add list to list(%testlist, $find regular expression(#FriendsPage_one, "(?<=name\\=\\\"fb_dtsg\\\"\\ value\\=\\\").+?(?=\\\"\\ autocomplete\\=)"), "Delete", "Global") 1 Quote Link to post Share on other sites
noname 2 Posted May 2, 2015 Author Report Share Posted May 2, 2015 Yes that did it!!your a life saver thanks alot 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.