Converting option tags to json with regex find : <option [^>]*?value="([^"]+)"[^>]*>([^<]*)</option> replace : "$1" : "$2", Done!