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

214
Vistas
How do I combine these three regex into one?

I'm trying to make a regular expression that only accepts:

Min 100 and atleast 1000 characters, characters “,’,<,> aren't allowed, two full stops one after another aren't allowed.

This is what I have for now:

  • ^.{100,1000}$ → for 100 to 1000 characters
  • ^[^"'<>]*$ → for the characters that aren't allowed
  • ^([^._]|[.](?=[^.]|$)|_(?=[^_]|$))*$ → doesn't allow 2 consecutive dots

How do I combine this regex into one? ._.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This part [^._] means no dot or underscore and this part [.](?=[^.]|$)|_(?=[^_]|$) matches either a . or _ followed by the opposite or end of string.

You could write the pattern using a single negative lookahead assertion excluding __ or ..

^(?!.*([._])\1)[^"'<>\n]{100,1000}$

Explanation

  • ^ Start of string
  • (?! Negative lookahead, assert that what is at the right is not
    • .*([._])\1 capture either . or _ and match the same captured char after it (meaning no occurrence of .. or __)
  • ) Close lookahead
  • [^"'<>\n]{100,1000} Match 100-1000 times any character except the listed
  • $ End of string

Regex demo (with the quantifier set to {10,100} for the demo)

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