Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function password(input) {
- for (let currPass of input.slice(1)){
- const regex = /(?<start>.+)>(?<numbers>[\d]{3})\|(?<lLetters>[a-z]{3})\|(?<uLetters>[A-Z]{3})\|(?<symbols>[^<>]{3})<(\k<start>)/gm;
- const match = regex.exec(currPass);
- if(match){
- const {numbers, lLetters, uLetters, symbols} = match.groups;
- let output = `${numbers}${lLetters}${uLetters}${symbols}`;
- console.log(`Password: ${output}`);
- }else{
- console.log(`Try another password!`);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement