lib/validate_zipcode/regex.rb in validate_zipcode-1.0.0 vs lib/validate_zipcode/regex.rb in validate_zipcode-1.1.0
- old
+ new
@@ -2,7 +2,12 @@
module Regex
def self.US(zipcode)
match = zipcode =~ /^([0-9]{5})$|([0-9]{9})$|([0-9]{5}-[0-9]{4})$/
match == 0 ? true : false
end
+
+ def self.BR(zipcode)
+ match = zipcode =~ /^([0-9]{5}-[0-9]{3})$|([0-9]{8})$/
+ match == 0 ? true : false
+ end
end
end