re = /([^\s=;]+=\[[^][]*])|;/m
str = 'L=1nH;Tol=0.3nH;Idc=1000mA;Isat=NA;Iacpp=NA;Fr=10GHz;ESR=0.10ohm;Q=[100MegHz 7; 500MegHz 23;1.8GHz 47;2.4GHz 57];dL@Isat=NA;dT@Idc=NA'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html