From: Regg Mr Date: 2006-05-23T19:41:26+09:00 Subject: Re: Problem with reqular expression Ilyas wrote: > I have this string: > > Color1 R=144 G=248 B=255 > > Need regular expression for get R,G,B > How I can simplify it: > > lines.gsub!(/Color1 R=(\d+) G=(\d+) B=(\d+)/) { > puts $1 > puts $2 > puts $3 > } lines.gsub!(/R=(\d+) G=(\d+) B=(\d+)/) {puts $1; puts $2; puts $3} =>144 =>248 =>255 You didn't use semi-colons within your block. -- Posted via http://www.ruby-forum.com/.