extract part of a string that is a number ruby code example Example: ruby extract number from string a.map {|x| x[/\d+/]}