FCC Regular Expressions: Find Characters with Lazy Matching

Fix the regex /<.*>/to return the HTML tag <h1>and not the text "<h1>Winter is coming</h1>". Remember the wildcard .in a regular expression matches any character.

let text = "<h1>Winter is coming</h1>";
let myRegex = /<h1*?>/; // Change this line
let result = text.match(myRegex);

Comments

Popular posts from this blog

Code Wars: Data Reverse (6 kyu)

Code Wars: longest_palindrome (6 kyu)

Code Wars: Find the odd int