3
Answers

WPF

Priya M

Priya M

9y
358
1
Hello,
 I worked on WPF .
I  want to create one class file for regex validation  for Moblie No is 10 digit &Only numeric, pincode is only 6 digit no,pancard no which is accept only alphabetic &numeric of 10 digit no ,address,telephone no and so on.
 
How I will Implement it.
please give me some sample code of How it is used
Answers (3)
0
Suresh M

Suresh M

NA 18.6k 1.5m 9y
write this code in new class file and you can call it any form
0
Priya M

Priya M

NA 38 4.1k 9y
I also write this code..
 
but how i will call this code on different form .
0
Suresh M

Suresh M

NA 18.6k 1.5m 9y
Regex pattern = new Regex(@"(?<!\d)\d{10}(?!\d)");

    if(pattern.isMatch(socialSecNumber))
    {
        //Do something
        return true;
    }
    else
    {
        return false;
    }