This works:
...
(field1, field2, field3, field4, field5) = line.split(/\s+/)
if field1 =~ /^is-/ then
puts "field1 #{field1} ${field5}"
end
--------------------------------------
this doesn't
...
(field1, field2, field3, field4, field5) = line.split(/\s+/)
if field1.match('/^is-/') then
puts "field1 #{field1} ${field5}"
end
Get the following message:
./dbparse-phase1.rb:18: undefined method `match' for nil:NilClass (NoMethodError)