Flowdock

Notes posted by Carol

RSS feed
May 5, 2014 - (v4.0.2)
0 thanks

Example Regex format matching

for phone and email

validates_format_of :phone, with: /\A(\d{10}|\(?\d{3}\)?[-. ]\d{3}[-.]\d{4})\z/
validates_format_of :email, with: /\A[\w]([^@\s,;]+)@(([\w-]+\.)+(com|edu|org|net|gov|mil|biz|info))\z/i