jLinux

Untitled

Dec 24th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "use strict";
  2.  
  3. var re = /^[a-z]{1}([a-z]{1})/im;
  4.  
  5. function getEnv(hostname){
  6.     var OK = hostname.match(re);
  7.  
  8.     if (!OK)
  9.         console.log(`No regex match for ${hostname}`);
  10.     else
  11.         console.log(`Matched: ${OK[0]}`);
  12. }
  13.  
  14. getEnv( process.argv[2] || 'ldserver01' );
Advertisement
Add Comment
Please, Sign In to add comment