19/01/19 09:54:02.71 9IabhBF0.net
>>860 Ruby
f = -> str {str.scan(/([A-Z]{2}|[a-z])((?:\d+\.)?\d+)?/).each_with_object({}){|(m, num), h| h["tmp#{m[0].upcase}"] = !num ? ' ' : num.match?(/\./) ? num.to_f : num.to_i}}
%w[
w900×HH WW×h1000 WW×HH w900/h100 w3.14/h2.72
].each{|e| h = f[e]; puts "#{e} -> " + h.map{|v| '%s = %p' % v}.join(', ')}
# =>
w900×HH -> tmpW = 900, tmpH = " "
WW×h1000 -> tmpW = " ", tmpH = 1000
WW×HH -> tmpW = " ", tmpH = " "
w900/h100 -> tmpW = 900, tmpH = 100
w3.14/h2.72 -> tmpW = 3.14, tmpH = 2.72