Link Search Menu Expand Document

Find Characters with Lazy Matching

Summary

  • The ? character can be used to search for the smallest possible match.

Final Code

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