Skip to content

Instantly share code, notes, and snippets.

@leonardortlima
Last active May 15, 2023 12:57
Show Gist options
  • Save leonardortlima/9f0be71bca4e505d3c0f58f98b73bec0 to your computer and use it in GitHub Desktop.
Save leonardortlima/9f0be71bca4e505d3c0f58f98b73bec0 to your computer and use it in GitHub Desktop.
Regex for Mercosul plate - brazilian version

(?=(?:.*[0-9]){3})(?=(?:.*[A-Z]){4})([A-Z0-9]){6}([0-9])

The plate must have:

  • Four letters
  • Three numbers
  • Characters don't have a fixed position, except for the last one, that must be a number.

Adapted from https://stackoverflow.com/a/29834536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment