Tell us what’s happening:
Hello I’m working on the regular expression
and I have done Lazy Matching task
below is my solution and there isn’t any problem
let text = "<h1>Winter is coming</h1>";
let myRegex = /<[h1]*?>/; // Change this line
let result = text.match(myRegex);
But I try also more simple solution and test shows me that I solved it but there isn’t any lazy matching
I just thinking that there is a little bug, because I can do it without any lazy solution
let myRegex = /<h1>/;
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36.
Link to the challenge:
This is not a bug. The tests verify if your code is able to solve them. They don’t actually verify your code. That would be quite impossible to do as not everyone writes code in the exact same way. Let me give a simple example:
Both codes are perfectly valid and do exactly the same. Yet, they’re written differently. In this example we’re just talking about a few lines of code. But as you progress in the challenges, the solutions require many more lines of code. It would be impossible to “predict” every possible answer a member might give as a solution.