What are the rules for validating a North American phone number? Also, is there a regex I can use? Is there a gem to do this?
regex
Here are few rules I have
class Phne def ad puts "Enter your phone number" re=gets.chomp if re= ~/\b^([0-9]{10})$\b/ puts "Valid phone number" else puts "Invalid phone number" end end end obj=Phne.new obj.ad