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

136
Vistas
Regex to prevent set of characters

I need to prevent user from entering the following set of chars: ~ " # % & * : < > ? / \ { | } .

Important is that, anything else will be allowed, but only the characters shown above will be forbidden.

Currently, I'm using the following regex but this does also forbid for example ! sign.

  private static folderRegex = /^[A-Za-z0-9_-]+[ßüÜöÖäÄ\w]*$/;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Just put the set of characters in an inverse set and add a ^ and a $ to stretch the pattern to the full length of the input.

 private static folderRegex = /^[^~"#%&*:<>?\/\\{|}]+$/;
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