This question shows research effort; it is useful and clear
2
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
それは非常に簡単です:
Match match = Regex.Match(username, @"/^[a-z0-9_-]{3,16}$/", RegexOptions.IgnoreCase);
if (!match.Success)
throw new Exception("Manglende/ugyldig brukernavn.");