Is valid user name by regex - Node.js Regular expression

Node.js examples for Regular expression:Validation

Description

Is valid user name by regex

Demo Code

     username : {//
          validator : function(value) { 
              return /^[a-zA-Z][a-zA-Z0-9_]{5,15}$/i.test(value); 
          }, /*from w  ww .j  ava2 s  . c o  m*/
          message : 'user name, start with letter (????,??6-16??,?????????)' 
     },

Related Tutorials