ruby regex extract first numeric characters from string code example Example: ruby extract number from string a.map {|x| x[/\d+/]}