且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

意外的关键字结束错误,但语法似乎很好

更新时间:2022-04-16 03:52:47

您的错误来自行:

current_word ++

Ruby 中没有这样的语法.应该是:

There's no such syntax in Ruby. It should be:

current_word += 1

此外,您错误地创建了正则表达式.应该是:

What's more, you create your regexp incorrectly. It should be:

namecatcher_regex = /^[\.{1}]([A-Z]+)\.{3}/

可能还有一些我没有注意到的其他错误.

There may be some other errors that I didn't notice.