Main Topics
Browse All TopicsDoes anyone have a C# Windows Forms
"Regular Expression" EXAMPLE that can
do the following "Password" textbox
validation when users setup their account ?
1. must be 8+ chars long
2. must include one+ number
3. must include one+ letter
4. must NOT include spaces
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I just now used http://www.ultrapico.com/E
to create the below "Regex" property.
How can I add this to my below "textBox1_Leave"
so the MessageBox displays if the format is invalid ?
--------------------------
private void textBox1_Leave(object sender, EventArgs e)
{
if (textBox1.Text..????????)
{
MessageBox.Show("Invalid Format");
}
}
--------------------------
public static Regex test1 = new Regex(
"([a-zA-Z0-9_\\-\\.]+)@((\
",3}\\.)|(([a-zA-Z0-9\\-]+
RegexOptions.IgnoreCase
| RegexOptions.CultureInvari
| RegexOptions.IgnorePattern
| RegexOptions.Compiled
);
Thanks, the below worked.
--------------------------
using System.Text.RegularExpress
namespace WindowsFormsApplication11
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_Leave(object sender, EventArgs e)
{
Match match = test1.Match(textBox1.Text)
if (!match.Success)
{
MessageBox.Show("Invalid Format");
}
}
public static Regex test1 = new Regex(
"([a-zA-Z0-9_\\-\\.]+)@((\
",3}\\.)|(([a-zA-Z0-9\\-]+
RegexOptions.IgnoreCase
| RegexOptions.CultureInvari
| RegexOptions.IgnorePattern
| RegexOptions.Compiled
);
}
}
I've tried this rule, but none of my test password pass the match checking... what is this means?
public static Regex test1 = new Regex(
"([a-zA-Z0-9_\\-\\.]+)@((\
",3}\\.)|(([a-zA-Z0-9\\-]+
RegexOptions.IgnoreCase
| RegexOptions.CultureInvari
| RegexOptions.IgnorePattern
| RegexOptions.Compiled
);
Business Accounts
Answer for Membership
by: rkworldsPosted on 2009-08-28 at 12:01:14ID: 25210620
Hi
om/UploadF ile/prasad _1/ RegExpP SD12062005 021717AM/R egExpPSD.a spx
http://www.c-sharpcorner.c