Thursday, July 18, 2019

Validate Pan card in C# using regular expression

public Boolean checkPan(string str)
  {
   if (Regex.IsMatch(str, @"^[\w]{3}(p|P|c|C|h|H|f|F|a|A|t|T|b|B|l|L|j|J|g|G)[\w][\d]{4}[\w]$"))
   {
    return true;
   }
   else
   {
    return false;
   }
  }

No comments:

Post a Comment

Lab 09: Publish and subscribe to Event Grid events

  Microsoft Azure user interface Given the dynamic nature of Microsoft cloud tools, you might experience Azure UI changes that occur after t...