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