type="checkbox" name="prdCdList" value="102001174" class="bnone" newfl="Y" cpnfl="N" catcpnfl="N" eventfl="N" catcd1="102000" catcd2="102001" prdimgl="/upload/product/320_1405497216907.jpg" prdnm="Dear my volume" prdvol="3.4g" prdlndesc="Limited Pink" selprc="10000" spsalprc="0" cpnprc="0" cashptrat="0" cashpt="0" discpt="0" salstatcdnm="Available" salstatcd="PS01" prdwidth="0" prdheight="0" prddepth="0" pricestr="" price="10000" prepromote="" endpromote=""
I am currently using bunch of regexes to parse above data into a structured array or hash. Actual tag includes much more values. Thought there must be a better way in Ruby like using split or something? There are spaces between attributes but also within certain values so..
Can any one suggest a good way to handle this type of string?
I would like the result be:
hash = {
type => "checkbox",
name => "prdCdList",
... so on.
}
or
arr = [
"checkbox",
"prdCdList",
... so on.
]
Would appreciate any advice =]
Thanks,