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

267
Vistas
How to parse specific words after text?

The text I would like to parse always comes in the following pattern:

"Your $22.12 transaction with Amazon.com"

I would like to parse all text after "transaction with " which would be the name of company/store.

Can anybody help with this? Thank you so much!


This question does not have a relevant enough answer here : Javascript Regexp - Match Characters after a certain phrase That question is about matching characters after a fixed, exact, constant phrase. The phrase in this question contains a substring (the $ amount) that varies. An answer should explain, in addition to how to get characters after text, how to match a dollar money amount with RegEx.

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

0

This Regular Expression may work:

Your \$\d+\.\d{2} transaction with (.*)

Just make a regex that matches the beginning phrase followed by (.*).

\d matches any digit character from 0 to 9.

The plus sign + matches 1 or more of what precedes it. \d+ matches 1 or more digits.

{2} matches exactly 2 of something. \d{2} matches 2 digits.

. matches any character. * matches zero or more of what comes before it. So Regex .* matches any number of any character, greedily. Wrapping .* in parentheses creates a capture group that lets you get the matched text after running the regex on it.

const txt = 'Your $22.12 transaction with Amazon.com'
const regEx = /Your \$\d+\.\d{2} transaction with (.*)/
const matches = txt.match(regEx)
document.write(matches[1])

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