SHARE
TWEET

Untitled

a guest Mar 26th, 2020 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(input) {
  2.     let pattern = /([A-Z])[a-z]+[   ]\1[a-z]+[^A-Z][^\, ]/g;
  3.     let validNames = [];
  4.  
  5.     while ((validName = pattern.exec(input)) !== null) {
  6.             validNames.push(validName[0]);
  7.     }
  8.  
  9.     console.log(validNames.join(' '));
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top