Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Write a windows program to ask the user to enter a new password and check whether the format of the password is matched with the required format or not. The required format for password is as wwwwddd (4 words, and 3 digits).For example, hero123 is valid. Use the Regular expression to check required format. You can design appropriate graphical user interface.
Posted
Updated 3-Feb-12 6:02am
v2
Comments
Wendelius 3-Feb-12 12:00pm    
Since this most likely is homework, what have you tried?

Since this is your homework, I think you should probably do it yourself!
It's not difficult, and I'm not too nasty, so I'll make a suggestion: Get a copy of Expresso [^] - it's free, and it examines and generates Regular expressions.
 
Share this answer
 
Comments
snehaww 3-Feb-12 12:37pm    
it's very helpful....thanks
Hi sir

Yes, this is my homework it's not i am lazy to do it, i have to try it for a long time but i can't done it, so i have asked you. As below i'm trying like this can you check it for me it's correct or not. Warm thanks


if (Regex.IsMatch(txtpassword.text, @"^[a-zA-Z]{4,4}\d{3}"))
{
MessageBox.Show("Valid");

}

else
{
MessageBox.Show("Invalid");
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900