From: w_a_x_man Date: 2010-11-17T18:00:24+09:00 Subject: Re: Parsing String Data On Nov 16, 7:57 am, Bob Theslob wrote: > I am very new to Ruby and I have an issue that I cannot seem to > solve. > > Parse a data string, excise four digits (non- adjoined)  in the middle > of the string, and then assemble a second string using the data. > > As an example, my fisrt string has text “Test Part 123 G 477”, I want to > assemble a new string  “AABB123477”. > > What I do not know how to do is parse the text to get the numbers.  Once > having them I have had no problems assembling the new string. "Test Part 12 or 3 G 477".gsub( /\D/, "" ) ==>"123477"