Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:55:12+00:00 2026-06-03T00:55:12+00:00

I am working with passwords now and want to make user to create complicated

  • 0

I am working with passwords now and want to make user to create complicated password. I use jQuery to check if password is long enough and how strong it is depending on used characters. Still, cant figure out how to make user to create password with no duplicated chars, so he cant make password like ‘111111111111111111111111’ or ‘1qAz1qAz1qAz’ etc.
My code is here:

$("#new_pass").keyup(function() {
    var newpass = $(this).val();
    var chars = 0;
    if((/[a-z]/).test(newpass)) chars +=  26;
    if((/[A-Z]/).test(newpass)) chars +=  26;
    if((/[0-9]/).test(newpass)) chars +=  10;
    if((/[^a-zA-Z0-9]/).test(newpass)) chars +=  32; 
    var strength = Math.pow(chars, newpass.length)
        alert(strength)
}

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:55:13+00:00Added an answer on June 3, 2026 at 12:55 am

    Perhaps you could use something simple like this:

     /(\w+)(?=\1)/g
    

    It matches one or more word characters then checks to see if they are followed by that exact string.

    Basic test (in Coffeescript)

     pattern = /(\w+)(?=\1)/g
     console.log pattern.test("1qAz1qAz1qAz")
     console.log pattern.test("111111111111111")
     console.log pattern.test("abcdefg")         
     console.log pattern.test("abccdefg")
    

    Outputs:

     true
     true
     false
     true
    

    As a side note, upper and lower case does matter, so for instance:

     pattern.test("abcCdefg")
    

    Would in fact return false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a password reset function and trying to check to make sure
I have a working PHP server. Now I want to use databases (MySQL or
I have a working web application that uses username/password SpringSecurity configuration. Now I want
I am working on a system that has been hashing user passwords with MD5
I am working with SQL Server and I want to set the Database password
Iam working on HTML.and As for now Im going well.But the thing I want
I have a simple create user wizard control and It's working pretty well upto
Im working on a form that needs a password that is between 6 and
So I'm working to hide the password from the ps -aux list, or w
I'm working on a simply password strength checker and i can not success applying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.