Results 1 to 3 of 3

Thread: Regular Expression help needed

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Regular Expression help needed

    I am trying to validate a password by using a regex.

    * Must be between 6 to 16 characters long
    * Must contain atleast 1 uppercase letter
    * Must contain atleast 1 lowercase letter
    * Must contain atleast 1 numeric "digit"

    So far so good ...
    Code:
    (?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,16})$
    * I am stuck here! Can optionally have any number of special characters listed below
    Code:
     ! @ $ - _ .
    Any help would be greatly appreciated.

    Cheers

  2. #2

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Re: Regular Expression help needed

    No one?

  3. #3
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Regular Expression help needed

    Never been too good with RegEx, but with all those conditions, maybe a nested IF structure would be better. It would allow you to narrow down to the reason the password condition wasn't met. With a single Regex, all you'll be able to do is "if regex=met then good, else not good". That doesn't tell you WHY it failed though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width