[Javascript] RegEx for Password w/ spl rules

allard schripsema allard-schripsema at procergs.rs.gov.br
Tue Jun 29 15:16:48 CDT 2004


Sorry about that... 
the quantifier didn´t work with the reference to the group.. I was afraid for that...
([0-9a-zA-Z])\1\1 does work however (but is ugly!!)

so you could use /[^a-z0-9A-Z at ._]|([0-9a-zA-Z])\1\1/ for now.

About quantifiers:
? optional
*  zero or more 
+  one or more
{3} exactly 3
{3,} 3 or more
{3,6} three to 6
They may reference to groups "()" 

What i wanted to do is to repeat the reference to a group...  \1{3} which apparently doesn´t work ... live and learn....


  ----- Original Message ----- 
  From: AMIT UCHAT 
  To: [JavaScript List] 
  Sent: Tuesday, June 29, 2004 4:34 PM
  Subject: Re: [Javascript] RegEx for Password w/ spl rules


  Allard/All...Thanks you very much for help.

  Can you please explain the second RegEx as how exactly it rejects string with same characters appears more then 3 times consecutively.
  /[^a-z0-9A-Z at ._] |([0-9a-zA-Z])\1{3,}/ 

  Also I am using online RegEx Validator for ease of use. It can be found at 
  http://home.tiscali.be/stevevh/tools/testRE.html
  I tested the regEx /[^a-z0-9A-Z at ._] |([0-9a-zA-Z])\1{3,}/  using the tool and it somehow doesn't work.

  I figured, I need to spend more time on understanding Quantifiers in RegEx esp curly braces. Is there any URL's or easy to understand tutorial for Quantifiers? or we can collectively develop it together with simple exampls.

  Thanks,
  Amit




  allard schripsema <allard-schripsema at procergs.rs.gov.br> wrote:
    Hi Amit,

    let me have a shot at this... (lets see if i can impress the masters :-)

    For the format validation i believe you´ll need 2 regexps
    you can use for validation 3 and 4  something like : 
    /[^a-z0-9A-Z at ._] |([0-9a-zA-Z])\1{3,}/ (<-don´t know if this works :-)
    "if not any of these or  repeat a char or number 3 or more times...." then error
    and for 2 and 3 
    /(.*[a-zA-Z].*[0-9].*)|(.*[0-9].*[a-zA-Z].*)/      two groups to have the situations num char and char num....
    "If any-no-thing char any-no-thing number any-no-thing  OR any-no-thing number any-no-thing char any-no-thing then OK

    for size you can use /^.{8,24}/ (anything , repeated 8 to 24 times)


    Hope this is any help...
    Allard

      ----- Original Message ----- 
      From: AMIT UCHAT 
      To: [JavaScript List] 
      Sent: Tuesday, June 29, 2004 1:33 PM
      Subject: [Javascript] RegEx for Password w/ spl rules


      Hi 
      I have been trying to Develop RegEx for a Password authentication with following rules:
      1) Must be between 8 - 24 characters
      2) Should have atleast 1 digit
      3) Should have atleast 1 Alphabatic Character
      3) Valid characters are [a-z0-9A-Z at ._]
      4) Any Characters cannot repeat more then thrice e.g. Password is "mynaaaame1" is      
         invalid because character 'a' repeated more then thrice consecutively.

      Rule # 1 is taken care of in password textbox by limiting textbox sixe with min=8 and max=24.

      Rule # 2 & 3: ^[a-z0-9A-Z at ._]+$

      Rule # 4: How do I apply it to ^[a-z0-9A-Z at ._]+$ RegEx?

      Any help/Hints/Direction be much appereciated.

      Adios,
      Amit










--------------------------------------------------------------------------
      Do you Yahoo!?
      New and Improved Yahoo! Mail - 100MB free storage! 


--------------------------------------------------------------------------


      _______________________________________________
      Javascript mailing list
      Javascript at LaTech.edu
      https://lists.LaTech.edu/mailman/listinfo/javascript

    _______________________________________________
    Javascript mailing list
    Javascript at LaTech.edu
    https://lists.LaTech.edu/mailman/listinfo/javascript



------------------------------------------------------------------------------
  Do you Yahoo!?
  Yahoo! Mail - Helps protect you from nasty viruses.


------------------------------------------------------------------------------


  _______________________________________________
  Javascript mailing list
  Javascript at LaTech.edu
  https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20040629/0f1abd7c/attachment.htm>


More information about the Javascript mailing list