Cant generate a [asswprd that has atleast 5 characters with 2 consecutive digits. Can anyone help with this?
let sampleWord = "astronaut";
let pwRegex = /(?=\w{1,}\d\d$)|(?=\d\d+\w{1,}$)/; // Change this line
let result = pwRegex.test(sampleWord);
Cant generate a [asswprd that has atleast 5 characters with 2 consecutive digits. Can anyone help with this?
let sampleWord = "astronaut";
let pwRegex = /(?=\w{1,}\d\d$)|(?=\d\d+\w{1,}$)/; // Change this line
let result = pwRegex.test(sampleWord);
I believe this problem is from this challenge
You can easily find the freeCodeCamp provided hint/solution here: freeCodeCamp Challenge Guide: Positive and Negative Lookahead
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.