0

I have doubt in below code which doesn't match regular expression:

 string strToCheck = "Rahul Chaudhary";
            Regex objAlphaPattern = new Regex("Rah* Chaudhary");
            if (objAlphaPattern.IsMatch(strToCheck)){
                Console.WriteLine(strToCheck);
            }

But, when i change

Regex objAlphaPattern = new Regex("Rah* Chaudhary");

to

Regex objAlphaPattern = new Regex("Rah*"); 

It works.

Please help me with regex to match the complete string, when my input is Rah* Chaudhary it should match Rahul Chaudhary.

Thanks.

AllTech
  • 563
  • 6
  • 27

0 Answers0