[Solved] Check string format consist of specific words then number then specific words in c# [closed]
It’s really easy to make a regular expression to get matches: string[] input = new string[6] { “[email protected]”, // match “[email protected]”, // match “[email protected]”, // match “[email protected]”, // not a match “[email protected]”, // not a match “[email protected]” // not a match }; string pattern = @”Auto_gen_\d{4}@mail.com”; //\d{4} means 4 digits foreach (string s in input) … Read more