Able to pass Restrict Possible Usernames with incorrect code
See original GitHub issueThis is the Regex challenge --> https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/restrict-possible-usernames
The specification of the code you will write is:
- The only numbers in the username have to be at the end. There can be zero or more of them at the end.
Yet it never actually checks for it, meaning you could cheat with the code below:
let username = "JackOfAllTrades";
let userCheck = /\w[a-z]/gi; // Change this line
let result = userCheck.test(username);
–> https://repl.it/@John_Nicole/Regular-Expressions-17761
If you actually tested for that, a username like 1JackOfAllTrades would fail this regex.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Restrict Possible Usernames - Free Code Camp - YouTube
In this regular expressions tutorial we -TITLE-. We're using regular expressions in conjunction with JavaScript methods.
Read more >freeCodeCamp Regular Expression, Restrict Possible ...
freeCodeCamp Regular Expression, Restrict Possible Usernames, ... beginner make sure to check out our course tutorials here at We Will Code !
Read more >RegEx Restrict Possible Usernames - JavaScript
Tell us what's happening: how to make usernames like ja4ck, du76de, or son495ja returns false/invalid? one of the rules is number characters ...
Read more >javascript - Regular Expressions | Restrict Possible Usernames
Solution 1: let username = "JackOfAllTrades"; let userCheck = /^[a-z]([0-9][0-9]+|[a-z]+\d*)$/i; let result = userCheck.test(username);.
Read more >Set Password Policies - Salesforce Help
A password can't contain a user's username and can't match a user's first or last name. Passwords also can't be too simple. For...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TomerPacific Yeah, feel free to submit a PR for this.
Closing in favor of the duplicate mentioned