Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- public class SimpleIdValidation
- {
- public static bool Validate(string id)
- {
- //---XXXXX--- with X alphanumeric and at least length of 1/at most of 5
- Regex regex = new Regex(@"(\-){3}([A-Za-z0-9]){1,5}(\-){3}");
- Match match = regex.Match(id);
- return (match.Success);
- }
- }
Add Comment
Please, Sign In to add comment