title: Strong Password Detection regex
body: <pre><code>#!/usr/bin/env python3
  
  import re
  
  passRegex = re.compile(r'''(
          .{8,}                     # 8 or more characters
          [A-Z]                     # at least 1 A-Z char
          [a-z]                     # at least 1 a-z char
          [0-9]                     # at least 1 0-9 number
          )''', re.VERBOSE)
  
      
  def strong_password():
      password = input(&quot;Enter a password: &quot;)
      match = passRegex.search(password)
      if (not match):
          print(&quot;Password not strong enough&quot;)
          return False
      else:
          print(&quot;Password is strong&quot;)
          return True
  
  strong_password()
  </code></pre>
  <p>This is from the automate the boring stuff with python chapter 7. Can someone explain what I am doing wrong? For some reason my regex doesn't work as intended.</p>
  <p>Here is the full question: Write a function that uses regular expressions to make sure the password string it is passed is strong. A strong
  password is defined as one that is at least eight characters long, contains both uppercase and lowercase
  characters, and has at least one digit. You may need to test the string against multiple regex patterns to
  validate its strength.</p>