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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:12:08+00:00 2026-06-13T16:12:08+00:00

I have this code in python. Actually i wanted to validate the password field

  • 0

I have this code in python.
Actually i wanted to validate the password field at server side using python. i want password to be alphanumeric in nature and thats what i have done so far

def valid():
    num = "[a-zA-Z0-9]"
    pwd = "asdf67AA"
    match  = re.match(pwd, num)
    if match:
        return True
    else:
        return False

its always returning false . It does not hit the IF condition. whats that i am missing

  • 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-13T16:12:09+00:00Added an answer on June 13, 2026 at 4:12 pm

    You have miss placed the argument in method reverse it .

    it will work.

    But this also matched if you set symbol in your string.
    so, i suggest you apply this things :

    pwd =”test5456″

    pwd.isalnum():

    This method will only work for if your string contain string or digit.

    if you want strongly want your password contain both numeric and string than this code will help you.

     test = "anil13@@"
     new = tuple(test)
     data = list(new)
     is_symb =False
     is_digit = False
     is_alpha = False
    
     for d in data :
        if d.isdigit() :
           is_digit = True
        if d.isalpha():
           is_alpha = True
        if not d.isdigit() and not d.isalpha():
           is_symb =True
           break
    if is_symb == False and is_digit == True and is_alpha == True:
       print "pwd matchd::::"
    else :
       print "pwd dosen't match..."
    

    Note :This code strongly work for numeric & symbol

    Regards,
    Anil

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

Sidebar

Related Questions

I have this code in Python inputted = input(Enter in something: ) print(Input is
In Python I have this code: now = datetime.now().isoformat() if . not in now:
I have this code: def display(self): print self.doc.toprettyxml(indent= ) strigName ='/Users/my_user/Desktop/python/' + str(datetime.datetime.now()) +
Say I have this sample code I'm writing for a Python lesson I'm holding:
I'm newbie in Python. I have this simple code a = 0 b =
I have a python script the runs this code: strpath = sudo svnadmin create
I have a python ndarray temp in some code I'm reading that suffers this:
I'm newbie in Python, but this question is not a homework (actually this code
Until recently, I posted Python code (whitespace matters) to blogspot.com using something like this:
I have this code <div id=main style=background:#aaaaaa;float:left;height:160px;margin:5px;position:relative;display:block;width:630px;> <div id=1 class=item style=background:#ffaacc;float:left;width:200px;height:150px;margin:5px;position:absolute;left:0px;top:0px;> </div> <div id=2

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.