Created
April 16, 2011 16:21
-
-
Save domgreen/923240 to your computer and use it in GitHub Desktop.
regex to check the naming of Azure Queues
This file contains 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
bool match = false; | |
var exp = new Regex(@"^[0-9a-z]+-*[0-9a-z]+$"); | |
if (exp.IsMatch(input)) | |
{ | |
if (input.Length >= 3 && input.Length <= 63) | |
{ | |
match = true; | |
Console.ForegroundColor = ConsoleColor.Green; | |
Console.WriteLine("VALID Queue Name: {0}", input); | |
} | |
} | |
if (!match) | |
{ | |
Console.ForegroundColor = ConsoleColor.Red; | |
Console.WriteLine("INVALID Queue Name: {0}", input); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment