jLinux

Untitled

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