I am trying below code to find valid and not-valid names
string pattern = @"((?:[GE\-[RGrp]+))";
foreach (var AzureResponse in Response)
{
if (AzureResponse.name!= null)
{
Console.WriteLine("{0},{1} a valid resource name.", AzureResponse.name, Regex.IsMatch(@AzureResponse.name, pattern) ? "is" : "Is not");
}
}
But it is printing out all the resources names are valid even though i know few are not, it seems i am not able to get the correct regex.
What i want is:
- any name which starts with "GE-RGrp" should be valid one and rest are not valid