I usually convert a hash into pulldown. However this time, I want to do the opposite. Does anyone knows how to do that using a regular expression? or any other way. Note that the pulldown contains optgroup and options. I only want the option, so that the id would be the key of the hash, and the value of the pulldown is the value of the hash.
Example if we have a pulldown as follows:
<select>
<optgroup label=fruits>
<option id=1>Apple</option>
<option id=2>Orange</option>
<option id=3>Pineapple</option>
<optgroup label=stuff>
<option id=4>Chair</option>
<option id=5>Board</option>
</select>
I want it to be
1=> "apple", 2=>"Orange",3=>"Pineapple",4=>"Chair", 5=>"Board"