void Main()
{
TestRegex("siddharth965388888888");
TestRegex("s-_]p[{};_~!@#$%.^&()_-+=");
TestRegex("siddharth mishra 9653");
}
// Define other methods and classes here
private void TestRegex(string str)
{
Regex reg = new Regex("^[^\\/?*:|<>\"]+$");
if (reg.IsMatch(str.ToString()))
Console.WriteLine("Matched");
else
Console.WriteLine("NO");
}
No comments:
Post a Comment