Interactive ruby ready.
> time = /\A(?<hours>(0\d|1[0-9]|2[0-3])):(?<minutes>([1-5]\d|0\d))\Z/
=> /\A(?<hours>(0\d|1[0-9]|2[0-3])):(?<minutes>([1-5]\d|0\d))\Z/
> match = time.match '11:30'
=> #<TypeError: can't dump MatchData>
I am trying to run the code but getting error as above. What the wrong I did with the regexp
help me to improve it.
EDIT
> time = /\A(0\d|1[0-9]|2[0-3]):([0-5]\d)\Z/
=> /\A(0\d|1[0-9??]|2[0-3])??:([0-5]\d)\Z/
> time.match('11:30')
=> #<TypeError: can't dump MatchData>
>