I’m getting a warning and an error:
rubytime.rb:18: warning: character class has `[' without escape
rubytime.rb:18: unmatched ): /^(\w+).*\([([\d]+)\+]?(\d\d):(\d\d)\)\s*$/
for this line:
if line =~ /^(\w+).*\([([\d]+)\+]?(\d\d):(\d\d)\)\s*$/
I’ve checked a few times and the parens/brackets seem to line up, though perhaps (having recently done perl) I’m making a false assumption about Regexps in Ruby.
Did you mean…
Also,
[\d]is equivalent to\d, so you could really write it as…If you don’t want the outer group to be a matching group, you can use the non-matching
(?: ):