[最佳答案] There is no reason to have to use a regular expression to parse HTML. One thing, you are not going to have a good time going it. Second, use the power of the DOM var contents = $("[id$=content]"); //find the elements that have an id that end with content var datas = $("[id$=data]"); //find the elements that have an id that end with data var details = {}; //object to hold results datas.each( function(i) { details[datas[i].value] = contents[i].value; }); //start looping and ge