str = "19097147835"p str.gsub(/\D/, '').sub(/\A1(?=\d{10})/, '').to_i
Standard input is empty
9097147835
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!