Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda