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

138
Vistas
jQuery REGEX filtering option text by a string integer

I want to create a RegExp that takes in a variable as part of the string.

I am parsing a list of options and I want to select the option based on if it's text contains a number but the problem is that just using .includes('1') will select 1: and 10:

I want the RegExp to do this:

/^{myNumber}:/

The option list I am trying to sort has numbers that look like this:

1: this is a string

2: comment

3: option

        let locatedTask = $task.find('option').filter(function() {
          if($(this).text().includes('1')){ 
            return $(this).html();
          }
        });
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