From: Joost Diepenmaat Date: 2006-05-23T19:34:46+09:00 Subject: Re: Problem with reqular expression On Tue, May 23, 2006 at 07:19:50PM +0900, 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 > } > Erm... "/Color1 R=(\d+) G=(\d+) B=(\d+)/" seems to me about as simple as you can get. I do wonder why you're using an in-place substitution, though. Joost.