From: Jim Freeze Date: 2003-02-13T00:11:16+09:00 Subject: Need regex help (or bug in match) Hi I seem to be having a problem with match and I can't figure it out. It's either a bug or I am doing something stupid and can't see the forest for the trees. Can regex guru help me out here? Thanks FETCH_DATA_HDR = /\[([^]]*)\]/ PUSH_DATA_HDR = Proc.new { |line| m = FETCH_DATA_HDR.match(line.strip) a = m[1].split(/\s*,\s*/, 2) hdr = [] p a hdr << {:X_VAR_NOM => a.shift} p a p a[0] s = /^([^(]*)\(/.match(a[0]) puts /Vg/ =~ a[0] #=> nil p s[1] #=> Vg # How can this match Vg when /Vg/ =~ a[0] == nil? } line = "[Vgs, Id(Vbs=0.0E+00), Id(Vbs=-4.5E-01), Vds=1.0E-01, Ref_Vs=0]" PUSH_DATA_HDR.call(line) -- Jim Freeze ---------- You cannot kill time without injuring eternity.