Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.6K
Vistas
REGEX: How to allow exclusive latin characters (like accents)?

So if you ever need a regular expression to verify whether a name has been inputted correctly for instance, and you want it to allow only Latin characters and accents, here's a solution:

\^([A-Za-zÀ-ÖØ-Ý]){2,20}$\

about 4 years ago · Santiago Gelvez
3 Respuestas
Responde la pregunta

0

But I owe you an explanation as to why we have À-ÖØ-Ý and not just À-Ý

Foremost, this explanation what made exclusively for beginners:

When you use [A-Z], you capture any ASCII character between A and Z : you capture a range.

If you look at the Unicode U0000 character map/ASCII Table (see below), you'll notice that it matches exactly all uppercase.

Screenshot of an ASCII Table, Unicode U0000

In the same way, you can capture the 4 last lines of the Unicode U0080: Screenshot of an ASCII Table, Unicode U0080

Though, you may realize that the multiplication (×) and division (÷) symbols are within that range.

Which is a problem because users (especially mobile users) could bypass the "only Latin letters" rule.

So to fix this issue we need to create 2 range of characters excluding these 2 characters.

Hence, why the À-ÖØ-Ýfor uppercase letters with accents and à-öø-ÿ for lowercase letters with accents.

I hope this will be useful to some people!

If you have any questions don't hesitate to ask them!

Sources:

https://fr.wikipedia.org/wiki/American_Standard_Code_for_Information_Interchange

https://fr.wikipedia.org/wiki/Table_des_caract%C3%A8res_Unicode/U0080

about 4 years ago · Santiago Gelvez Denunciar

0

Saul Orozco Alvarez

about 3 years ago · Saul Orozco Denunciar

0

Saul Orozco Alvarez

about 3 years ago · Saul Orozco Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda