Posts by Paulo Merson • 111 points
1 post
-
1
votes4
answers120536
viewsA: Regular expression to validate a field that accepts CPF or CNPJ
For a simple input (allows typing only CPF or CNPJ): ^(\d{2}\.?\d{3}\.?\d{3}\/?\d{4}-?\d{2}|\d{3}\.?\d{3}\.?\d{3}-?\d{2})$ For an input or text box where the CPF or CNPJ may appear at the beginning,…
regexanswered Paulo Merson 111