Find Characters with Lazy Matching --- help

Tell us what’s happening:
Why is there an asterix in the code used in the explanation /t[a-z]*i/ ?

Doesn’t astrix mean that the immediate preceding condition is optional? In which case it should have matched and returned [“ti”] the first time without the need for a “?”.

Where lies my misunderstanding?

Your code so far


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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/find-characters-with-lazy-matching/

I’m talking about the explanation section, the titanic example.

But if the regex is /t[a-z]*i/ and so in “titanic” the ‘t’ and ‘i’ are right next to each other, so then shouldn’t the regex be like, “matched ‘t’ now the optional [a-z] isn’t there and then there is ‘i’ so task complete”?

I’m so sorry I mistyped…I meant /t[a-z]*i/ which was my original question. I edited the earlier comment so you if you can please re-read my earlier reply and respond accordingly.