(This is greasemonkey with jquery)
I have a string of data which is retrieved with
$.post('page.php',function (data) { ... });
In that data, there are html tags like
<option value='numeric'>data</option>
along with random, useless information.
I want to be able to loop through each match and get the numeric value and the data between the option tags.
How would I do this? I tried:
reg = new RegExp(/<option value=\'(.+?)\'>(.+?)<\/option>/);
var result;
while (result = reg.exec(data)) {
GM_log(result);
}
However, that returns all sorts of failures. What am I doing wrong?