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
How to Get Specific text from string address using regular expression?

I have been trying to extract the 'XYZ Name' from this address:

*Address: *

XYZ Name
X Address
Y Address
Z Address

if we have an address like this:

Address:
XYZ Name
X Address
Y Address
Z Address

then we can use the following regular expression to get Address and XYZ Name:

var myRegex1 = /Address\s*.*/mi;
var bracket2 = myRegex2.exec(msgBody);

But due to the changed format of Address to *Address: *, this regular expression doesn't work anymore. Any suggestion would be much appreciated.

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

0

So from the regular expression provided by @Gurmanjot Singh, I was able to extract the required text mentioned in the question. So following snippet can be used for that:

var myRegex2 = / *\*?Address\s*\*?\s*(.+)/g;
var bracket2 = myRegex2.exec(msgBody); 
Logger.log(bracket2[bracket2.length-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