2016年6月29日 星期三

c# Regular Expression

Regular Expression

Regex regularExpression = new Regex("^[a-zA-Z0-9_]*$");


//contains only upper and lowercase letters, numbers, and underscores.




  • * ^ : start of string
  • [ : beginning of character group
  • a-z : any lowercase letter
  • A-Z : any uppercase letter
  • 0-9 : any digit
  • _ : underscore
  • ] : end of character group
  • * : zero or more of the given characters
  • $ : end of string
  • 沒有留言:

    張貼留言