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

204
Vistas
How to check via Yup if input is mail or username?

I have a field that I want to validate if it is a username or a mail address. I am using Yup for validation but having trouble setting up the correct Yup schema.

If the input is neither a mail address nor a username the validation should fail. In other words, one of the two conditions must be met to pass validation.

let schema = yup.object().shape({
  email: yup.string().email(), 
});
// username pattern
var pattern = new RegExp(/^(?=[a-zA-Z0-9._]{5,25}$)[^_.].*[^_.]$/); 
about 4 years ago · Juan Pablo Isaza
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