• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regular expression for username

 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I am trying to validate username using validator rules

For my username, the requirements are

First character should be a-z,A-Z
Remaining characters can be a-z,A-Z,0-9,_

i want regular expression to include in the mask

I tried giving ^[a-zA-z]\d{1}[a-zA-Z0-9_]\d{2,25}

its not working,

Hope anyone correct me

Thanks in advance
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it


^[a-zA-Z\.]{1}[a-zA-Z0-9_]{2,25}$

Sorry for the trouble
 
reply
    Bookmark Topic Watch Topic
  • New Topic