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

160
Vistas
Regex pattern for a string that ends with a space then a letter

I’m trying to make a regex pattern that would return true for when the string ends with a single letter.

Hello dear - false

Hello D - true

HelloD - false

Tried /\[^/sA-Z\]/ but of course that did not work :(

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

0

You should be using the end ($) flag

/\s[A-Za-z]$/
about 4 years ago · Juan Pablo Isaza Denunciar

0

Ends in single letter

function isAllaz() {
  let a = ["Hello dear", "Hello D", "HelloD"];
  let o = a.map(s => {return `${s} - ${(s.match(/^.* [A-Za-z]$/))? 'true': 'false'}`});
  console.log(JSON.stringify(o));
}

Execution log
10:38:41 PM Notice  Execution started
10:38:42 PM Info    ["Hello dear - false","Hello D - true","HelloD - false"]
10:38:42 PM Notice  Execution completed
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