Skip to content

Instantly share code, notes, and snippets.

@GabrielBdeC
Created May 31, 2024 01:53
Show Gist options
  • Save GabrielBdeC/7ed21782b838afe876848aa20b71b416 to your computer and use it in GitHub Desktop.
Save GabrielBdeC/7ed21782b838afe876848aa20b71b416 to your computer and use it in GitHub Desktop.
// Com máscara
/^\+?55 ?(\(\d{2}\)|\d{2}) ?(9 ?\d{4}|[2345]\d{3})(-?| ?)\d{4}$/
// Sem máscara
/^55\d{2}(9\d{4}|[2345]\d{3})\d{4}$/
Obrigatório uso de 55, se for opcional, adicionar ? após o 55
9 é opcional, mas, se for não usado, apenas aceita 2 a 5 (números fixos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment