Files
2018-10-16 21:32:40 +05:30

515 B

title, localeTitle
title localeTitle
Find Characters with Lazy Matching Encuentra personajes con Lazy Matching

Encuentra personajes con Lazy Matching

Challange

/<.*>/ la expresión regular /<.*>/ para devolver la etiqueta HTML <h1> y no el texto <h1>Winter is coming</h1> . Recuerda el comodín. En una expresión regular coincide con cualquier carácter.

Solución:

let text = "<h1>Winter is coming</h1>"; 
 let myRegex = /<h1>?/; // it's the answer! 
 let result = text.match(myRegex);