Last active
June 4, 2019 14:55
-
-
Save skysan87/527b213fc083df15913ea4e4bcfe3033 to your computer and use it in GitHub Desktop.
[C#] 正規表現サンプル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool isMatch(string input) | |
{ | |
// 英字小文字、大文字、数字を1つずつ含み、8文字以上(記号は含まない) | |
var pattern = @"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,}$"; | |
// NOTE:記号を含む場合、ASCII表記の方が楽かも[\x21-\x7e] | |
return Regex.IsMatch(input, pattern); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment