Confusion about Find Characters with Lazy Matching

Tell us what’s happening:
Describe your issue in detail here.
I am confused about the . and * in this code, I know about their function, I just do not understand what do they do in this code. Also, I have deleted the . , *and it returned “null”.

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 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Find Characters with Lazy Matching

Link to the challenge:

The .is any character, .+ is one or more of any character

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.