Regex wildcard period

Tell us what’s happening:
Describe your issue in detail here.

The solution shows /.un/ and my code is /un./ and still passes. Does the period placement matter?

Your code so far


let exampleStr = "Let's have fun with regular expressions!";
let unRegex = /un./; // 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/98.0.4758.82 Safari/537.36

Challenge: Match Anything with Wildcard Period

Link to the challenge:

Yes it does. Your code passes because tests are written in such way that they only test if there is a . and if your regex matches anything (or doesn’t for the last two tests). So I’d say that tests should be updated (freeCodeCamp/match-anything-with-wildcard-period.md at main · freeCodeCamp/freeCodeCamp · GitHub)

1 Like

Ah makes sense. Thanks!

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.