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

215
Vistas
Regex to match the data between the double quotes

I have below strings

1. "Settings Icon": "xxhdjxxx7wn"
2. "Settings Icon": "afewfwl"
3. "Settings Icon": "fdj ssde"

I want the regex to match all these strings by ignoring the content in right side of colon

I have (['"])(?:(?!\1|\\).|\\.)*\1 which matches with content inside double quote. But couldn't solve above case.. Please help

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

0

If I understand you're question correctly, you only want the string within the quotes, from the left side of the colon. Is that correct? If so, this might work for you:

(['"])([^\1]*?)\1:.*$

For this expression, capture group 2 will give you what you want.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Use

const string = `1. "Settings Icon": "xxhdjxxx7wn"
2. "Settings Icon": "afewfwl"
3. "Settings Icon": "fdj ssde"`

console.log( string.match(/(?<=")[^"]+(?=":)/g) )

DEMO

enter image description here

EXPLANATION

--------------------------------------------------------------------------------
  (?<=                     look behind to see if there is:
--------------------------------------------------------------------------------
    "                        '"'
--------------------------------------------------------------------------------
  )                        end of look-behind
--------------------------------------------------------------------------------
  [^"]+                    any character except: '"' (1 or more times
                           (matching the most amount possible))
--------------------------------------------------------------------------------
  (?=                      look ahead to see if there is:
--------------------------------------------------------------------------------
    ":                       '":'
--------------------------------------------------------------------------------
  )                        end of look-ahead

See regex proof.

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