Jump to content


Photo

Regex - Regular Expression Validator


  • Please log in to reply
2 replies to this topic

#1 davej

davej

    Devoted Member

  • Moderator
  • PipPipPipPipPip
  • 2,046 posts
  • Gender:Male
  • Location:STL
  • Interests:Learning web development.

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.n...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.
This concludes this test of our sanity -- you may now return to your regular programming.

#2 birbal

birbal

    Devoted Member

  • Members
  • PipPipPipPipPip
  • 2,531 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
Tools: Mozilla tools || Mobile emulator ||
IDE: Netbeans 7.3 on Twilight theme (php) , Eclipse(java)
Debugger: Xdebug, Cachgrind
stop using mysql extension it is obsolete now. use mysqli instead or more better PDO for secure ,efficient database handle

#3 davej

davej

    Devoted Member

  • Moderator
  • PipPipPipPipPip
  • 2,046 posts
  • Gender:Male
  • Location:STL
  • Interests:Learning web development.

Posted 02 April 2011 - 03:31 PM

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.
This concludes this test of our sanity -- you may now return to your regular programming.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users