Skip to content

Instantly share code, notes, and snippets.

@jls
Created August 7, 2009 15:21
Show Gist options
  • Save jls/163953 to your computer and use it in GitHub Desktop.
Save jls/163953 to your computer and use it in GitHub Desktop.
Regex longFormat = new Regex(@"^15-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}$");
Regex shortFormat = new Regex(@"^5-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}$");
return (longFormat.IsMatch(str) || shortFormat.IsMatch(str));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment