Skip to content

Instantly share code, notes, and snippets.

@rodrigopinto
Created June 2, 2010 20:39
Show Gist options
  • Save rodrigopinto/422959 to your computer and use it in GitHub Desktop.
Save rodrigopinto/422959 to your computer and use it in GitHub Desktop.
#
# Validates format to CNH ( category permission to drive on Brazil)
#
validates_format_of :license_category, :with => /(^[ABCDE]{1}$)|(AB)/
#
# Validates format to License Plate format to Brazil
#
validates_format_of :license_plate, :with => /([A-Z]{3})\-([0-9]{4})/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment