SHARE
TWEET

Untitled

a guest Mar 24th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function matchNames(names) {
  2.     let  pattern = /\b[A-Z][a-z]*[ ][A-Z][a-z]+\b/g;
  3.     while ((validNames = pattern.exec(names)) !==null) {
  4.         validNames.push(validNames[0]);
  5.        
  6.     }
  7.     console.log(validNames.join(' '));
  8.    
  9. }
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