Rubyでsplit関数を使用する際に問題が発生しています。
/Users/simonprochazka/Downloads/pes_test_p00/lib/main.rb:28:正規表現の早期終了:/(/Ruby:分割:正規表現の早期終了
File.open(ARGV[0], "r") do |f|
f.each_line do |line|
data = line.split(/\t/)
puts data[4]
if data[4] =~ ["("]
special = data[4].split(/(/)
scores = special[0].split(/:/)
puts data[4]
else
scores = data[4].split(/:/)
end
if special[1] != nil
matches << Match.new(data[0], scores[0], scores[1], special[1].chop)
else
matches << Match.new(data[0], scores[0], scores[1])
end
end
end
「irb(main):006:3> special = data [4] .split(/(/)」 これは問題の行ですか、あなたのソースに28行目がありますかわかりません。 – philosodad
はい、それは彼です。 – Fallion