Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.6K
Views
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 answers
Answer question

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 Report

0

Saul Orozco Alvarez

about 3 years ago · Saul Orozco Report

0

Saul Orozco Alvarez

about 3 years ago · Saul Orozco Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!