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

290
Views
Cómo escribir una expresión regular que permita cualquier carácter alfabético pero solo un punto (.), una coma (,) y un apóstrofe (') permitidos en la cadena

Estoy tratando de escribir una expresión regular similar a

 ^[a-zA-Z.{0,1},{0,1}'{0,1}]*

Sin embargo, esto puede aceptar más de una coma, punto y apóstrofes.

Por ejemplo, se permite "String.,'" pero no se debe permitir "str.,..,,,'''".

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

0

Usar

 ^(?!.*([.,']).*\1)[a-zA-Z.,']*$

Ver prueba de expresiones regulares .

EXPLICACIÓN

 -------------------------------------------------------------------------------- ^ the beginning of the string -------------------------------------------------------------------------------- (?! look ahead to see if there is not: -------------------------------------------------------------------------------- .* any character except \n (0 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- ( group and capture to \1: -------------------------------------------------------------------------------- [.,'] any character of: '.', ',', ''' -------------------------------------------------------------------------------- ) end of \1 -------------------------------------------------------------------------------- .* any character except \n (0 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- \1 what was matched by capture \1 -------------------------------------------------------------------------------- ) end of look-ahead -------------------------------------------------------------------------------- [a-zA-Z.,']* any character of: 'a' to 'z', 'A' to 'Z', '.', ',', ''' (0 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- $ before an optional \n, and the end of the string
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!