I use in my model following regular expression for getting a number that must to have a length 8. I do it this way:
validates_uniqueness_of :my_number, :with => /^[0-9]{8}$/, :message => "error message"
But this doesn't works me, if I set into the input "hahaha", I will get the "error message", if I set there 123, so I will get a success output, but that's wrong... I try to get a regular expression that will accepted always exact 8 digits...