From: Dave Thomas Date: 2000-06-12T10:40:04-05:00 Subject: [ruby-talk:03307] Re: dev.rubycentral.com Aleksi Niemel� writes: > Dave's example for MatchData.[] > > m = /(.)(.)(\{}d+)(\{}d)/.match("THX1138.") > > returns nil on my Win (rbdj144) environment. I was wondering for a while why > you have (\{}d+) and then I got it. Maybe it belongs to the same class as > other Latex environments :). Haven't seen such regexp anyway. Sorry about that - this LaTeX to html conversion is tough, but we'll get the bugs out. Unfortunately we've having to do it ourselves - the standard latex2html script chokes on much of our stuff. > ruby> m=/(.)(.)(\d+)(\d)/.match("THX1138.") > # > ruby> m[0] > "" > ruby> m[0,5] > [nil] That's a problem with using eval.rb. Try typing it into a file and running it, or better yet, have a play with irb: dave[ruby/sample 10:39:33] irb irb(main):001:0> m=/(.)(.)(\d+)(\d)/.match("THX1138.") # irb(main):002:0> m[0] "HX1138" irb(main):003:0> m[0,5] ["HX1138", "H", "X", "113", "8"] Dave