On Nov 14, 2008, at 11:01 AM, Shandy Nantz wrote: > Rob Biedenharn wrote: >> >> Oh, I see part of your problem: You need to group the alternation to >> see what you want. >> => An UPPER with one or more lowers, >> followed by some characters within >> square brackets >> v---------------------v >> /(\w|\s)+, [A-Z]{2}|[A-Z][a-z]{1,}\[(.+?)\]/ >> ^----------------^ >> => Some word or >> space characters, >> a comma, >> and 2 letters >> >> I think you intended to have: >> v------v >> /(\w|\s)+, (?:[A-Z]{2}|[A-Z][a-z]{1,})\[(.+?)\]/ >> ^------------^ >> Grouped with (?: ) which is a non-capturing group. >> >> (But my earlier message still holds.) >> >> -Rob >> >> Rob Biedenharn http://agileconsultingllc.com >> Rob / AgileConsultingLLC.com > > Can you direct me to some good online resources where some Ruby > methods > ar listed? I didn't know that there was a method for a string named > "match" that would return a string and not just chomp of various > characters. I have a book on Ruby an it is well writen but a list on > methods broken down to what methods are for which classes would be > helpful? Thanks, > > -S If you don't have a copy of "Programming Ruby"[1] aka, the Pickaxe book, it's well worth getting. If you are new to Ruby, you can get pretty far with the online first edition[2] which covers Ruby 1.6 (second edition is 1.8, anticipated 3rd edition is 1.9 and currently a beta-book). You can locally use ri (or get fri, the fastri alternative) to get docs. ri String ri String#match ri Regexp#match ri MatchData -Rob [1] http://www.pragprog.com/titles/ruby/programming-ruby [2] http://www.ruby-doc.org/docs/ProgrammingRuby/ Rob Biedenharn http://agileconsultingllc.com Rob / AgileConsultingLLC.com