Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function password(input) {
  2.  
  3. for (let currPass of input.slice(1)){
  4. const regex = /(?<start>.+)>(?<numbers>[\d]{3})\|(?<lLetters>[a-z]{3})\|(?<uLetters>[A-Z]{3})\|(?<symbols>[^<>]{3})<(\k<start>)/gm;
  5.  
  6. const match = regex.exec(currPass);
  7. if(match){
  8. const {numbers, lLetters, uLetters, symbols} = match.groups;
  9. let output = `${numbers}${lLetters}${uLetters}${symbols}`;
  10. console.log(`Password: ${output}`);
  11. }else{
  12. console.log(`Try another password!`);
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement