Tell us what’s happening:
I am able to solve all the other objectives but not “sun”
Your code so far
let exampleStr = "Let's have fun with regular expressions!";
let unRegex = /.un/gi; // Change this line
let result = unRegex.test(exampleStr);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
.
Challenge: Match Anything with Wildcard Period
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
Sky020
June 8, 2020, 11:34am
2
Thank you, for bringing this to my attention. I have been looking for this issue. This issue has been mentioned on the GitHub repo.
A quick solution is to remove the g
flag at the end of your regex.
But Why is it happening ? only with the “sun”
I don’t think I understand this!
Sky020
June 8, 2020, 11:40am
4
1 Like
Thank you so much, So global isn’t necessary, So we reject it?
Sky020
June 8, 2020, 11:49am
6
In this case, global is not necessary, but your solution is not incorrect with it; the tests just need to be adjusted slightly, as this was an unexpected bug.
1 Like