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

306
Views
Regex to keep all letters in all alphabets along with digits and underscore (problem on hindi letters)

I found out a regex pattern to remove all non alphabet letters: \p{L}

I thus did a regex to remove all non alphabet, non digit and non underscore pattern : /[^\p{L}\d_]/gimu

Unfortunately, it does not work with a hindi character like #फ्रांस which gives फरस

See for yourself here https://regex101.com/r/dnXDK0/1

And please help me :-)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You forgot about diacritics. You need to add \p{M} or \p{Mn} into the negated character class:

/[^\p{L}\p{M}\d_]/gu

See the regex demo.

Note you do not need the i and m flags here. m redefines anchor behavior, but your regex contains no ^ nor $. i makes caseful letters match in a case insensitive way, but \p{L} matches all letters, upper- and lowercase ones.

about 4 years ago · Juan Pablo Isaza 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!