Help in regular expression

Hello, can someone help me in providing a regular expression who 'se adequter with a string who have a min required length 6 characters . in these caracters 2 , minmum, are none alphanumerical characters thanks
[211 byte] By [Maaloul] at [2008-2-8]
# 1

hi,

regular expressions are tricky and i bit if anyone can provide you with this , whitout a trial

this is a nice tutorial about regex

http://www.codeproject.com/dotnet/regextutorial.asp

and this page has a nice program might help you to build your own regex

http://www.codeproject.com/dotnet/expresso.asp

hope this helps

Egyptian at 2007-8-30 > top of Msdn Tech,.NET Development,Regular Expressions...
# 2
Maaloul wrote:
.. adequter with a string who have a min required length 6 characters . in these caracters 2 , minmum, are none alphanumerical characters thanks

The issues in red need to be clearly stated. It looks like these are the rules

  1. 6 characters minimum
  2. 2 characters non alpanumeric [A-Z]
  3. (Implied) 4 alphabetic characters
From those rules ^.*(?=.{6,})(?=.*[@#$%^&+=]){2,}(?=.*[a-z\d]).*$


// using System.Text.RegularExpressions;

/// <summary>
/// Regular expression built for C# on: Thu, Jul 20, 2006, 08:14:01 PM
/// Using Expresso Version: 2.1.2150, http://www.ultrapico.com
///
/// Password 6 characters minimum. Four alpanumeric
///
/// A description of the regular expression:
///
/// ^.*
/// Beginning of line or string
/// Any character, any number of repetitions
/// Match a suffix but exclude it from the capture. [.{6,}]
/// Any character, at least 6 repetitions
/// Match a suffix but exclude it from the capture. [.*[@#$%^&+=]], at least 2 repetitions
/// .*[@#$%^&+=]
/// Any character, any number of repetitions
/// Any character in this class: [@#$%^&+=]
/// Match a suffix but exclude it from the capture. [.*[a-z\d]]
/// .*[a-z\d]
/// Any character, any number of repetitions
/// Any character in this class: [a-z\d]
/// .*$
/// Any character, any number of repetitions
/// End of line or string
///
///
/// </summary>
public Regex MyRegex = new Regex(
@"^.*(?=.{6,})(?=.*[@#$%^&+=]){2,}(?=.*[a-z\d]).*$",
RegexOptions.None
);


OmegaMan at 2007-8-30 > top of Msdn Tech,.NET Development,Regular Expressions...

.NET Development

Site Classified