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 3983122
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:36:35+00:00 2026-05-20T05:36:35+00:00

I am trying to get one regular expression that does the following: makes sure

  • 0

I am trying to get one regular expression that does the following:

  1. makes sure there are no white-space characters
  2. minimum length of 8
  3. makes sure there is at least:
    • one non-alpha character
    • one upper case character
    • one lower case character

I found this regular expression:

((?=.*[^a-zA-Z])(?=.*[a-z])(?=.*[A-Z])(?!\s).{8,})

which takes care of points 2 and 3 above, but how do I add the first requirement to the above regex expression?

I know I can do two expressions the one above and then

\s

but I’d like to have it all in one, I tried doing something like ?!\s but I couldn’t get it to work. Any ideas?

  • 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-05-20T05:36:36+00:00Added an answer on May 20, 2026 at 5:36 am
    ^(?=.*[^a-zA-Z])(?=.*[a-z])(?=.*[A-Z])\S{8,}$
    

    should do. Be aware, though, that you’re only validating ASCII letters. Is Ä not a letter for your requirements?

    \S means “any character except whitespace”, so by using this instead of the dot, and by anchoring the regex at the start and end of the string, we make sure that the string doesn’t contain any whitespace.

    I also removed the unnecessary parentheses around the entire expression.

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

Sidebar

Related Questions

I am trying to write a regular expression that can parse the text between
I'm trying to complete a regular expression that will pull out matches based on
I'm creating a CSS editor and am trying to create a regular expression that
I'm no expert on Regex. I'm trying to create a regular expression that will
I am trying to write a regular expression that matches only any of the
I have the following regular expression: /(?<={index:)\d+(?=})/g I am trying to find index integer
I'm trying to learn from reading Mozilla documentation for regular expressions, but there's one
I am trying to get a One-To-Many relation working. I have the following mappings:
I setup phpMyID on one of my machines, and I'm trying to get apache
I'm trying get values from a GridView using the following code: foreach (GridViewRow row

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.