Jump to content


Regex - Regular Expression Validator


2 replies to this topic

#1 davej

    Invested Member

  • Members
  • PipPipPip
  • 616 posts
  • Gender:Male
  • Location:STL
  • Interests:Learning Javascript, Java, Php, Linux, C, C#, C++, VB, (X)HTML, CSS, SQL, ASP.Net

Posted 01 April 2011 - 08:33 PM

I am looking at this regex thing but I don't understand the issue of "lookahead/lookbehind." Can I exclude a list of patterns in ASP.NET 3.5 ? I am guessing that the regex thing will have to be followed by a function that will exclude my list of unwanted patterns.

For example from...

http://www.zorched.net/2009/05/08/password...ar-expressions/

The password strength idea looks interesting but...

^.*(?=.{6,15})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[\!\@\#\$\%\^\&]).*$

...still matches Password#1, which isn't such a great password...

http://regexpal.com/

Ref...

http://msdn.microsof...y/ms972966.aspx

Thanks.

#2 birbal

    Devoted Member

  • Members
  • PipPipPipPipPip
  • 2,401 posts
  • Gender:Male
  • Location:india->kolkata
  • Interests:everything about computer and programming:specifically Web development and everything others which makes me interested
  • Languages:(x)html,css,(pl)sql,php,xml,xslt,xsd,javascript,java

Posted 01 April 2011 - 09:29 PM

http://reguler-expre...lookaround.html for look around related information
Developer Tools:Mozilla tools || Mobile emulator
stop using mysql extension it is obsolete now. use mysqli instead or more better PDO for secure ,efficient database handle

#3 davej

    Invested Member

  • Members
  • PipPipPip
  • 616 posts
  • Gender:Male
  • Location:STL
  • Interests:Learning Javascript, Java, Php, Linux, C, C#, C++, VB, (X)HTML, CSS, SQL, ASP.Net

Posted 02 April 2011 - 03:31 PM

View Postbirbal, on Apr 1 2011, 03:29 PM, said:

http://www.regular-e...lookaround.html for look around related information


Yes, I am looking around. I see now that my example allows whitespace so it is not valid for my intended use. It is difficult to find good examples of exclusions. I think that (?!pattern1|pattern2|pattern3) is the basis for exclusions but I can't seem to make it work.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users