Archive for March 31st, 2008
Daily Archive
Monday, March 31st, 2008
Regular expression checking of landline/mobile UK numbers in Ruby on Rails
Problem
You want to have validations for phone numbers in Ruby on Rails code.
Solution
The mobile numbers in UK should start with a 0, followed by 7, then a number between 5 and 9, and finally another 8 numbers.
For the landline numbers in UK the number should start with 0, followed by either 1 and 8 or [...]