Skip to content

Instantly share code, notes, and snippets.

@cansadadeserfeliz
Created June 19, 2014 22:06
Show Gist options
  • Save cansadadeserfeliz/b7036f4812c003046e04 to your computer and use it in GitHub Desktop.
Save cansadadeserfeliz/b7036f4812c003046e04 to your computer and use it in GitHub Desktop.
RegExp: Placas de carros colombianos. Colombian car plates validator.
from django.core.validators import RegexValidator
plates_validator = RegexValidator(
r'^([A-Z]{3}\d{3}|[A-Z]{2}\d{4}|[A-Z]{2}\d{3}[A-Z]|[A-Z]\d{4,5}|[A-Z]{3}\d{2}[A-Z])$',
u'Combinaciones posibles: ABC123, AB1234, AB123C, A1234, A12345, ABC12D'
)
# http://www.regexr.com/391ai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment