Unexpected keyword_end error, yet syntax seems fine

Your error comes from line:

current_word ++

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.

Leave a Comment