str = "19097147835"str.gsub(/\D/, '').match(/\A1\K\d{10}\z/) do |match| puts match[0].to_iend
Standard input is empty
9097147835
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!