Tell us what’s happening:
Describe your issue in detail here.
why is this still working even tho I added 3 wildcard ( . ) in a row?
could anyone explain me?
Your code so far
let text = "<h1>Winter is coming</h1>";
let myRegex = /<...*?>/gi; // Change this line
let result = text.match(myRegex);
console.log(result)
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Regular Expressions - Find Characters with Lazy Matching
The first two wild cards are asking for there to be at least two characters, so <h1>. The third wildcard has * which will match zero or more of the previous character, and ? will try and limit the amount of characters * finds to as few as possible. So that regex is looking for at least two characters, but the third or more character is optional, because there can be zero of them. That is why its also seeing </h1> with three characters, and it will also see <something else much longer>.