how to create a password in python 1 alphabet 1 digit 1character

0 votes
Sep 17 in Python by GHAZALA
• 160 points
47 views

1 answer to this question.

0 votes

You can make use of this: 

^(?=.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%^&*()_+])[A-Za-z\d][A-Za-z\d!@#$%^&*()_+]{7,19}$
  • [A-Za-z\d] Ensures that the first character is an alphabet or digit.

  • [A-Za-z\d!@#$%^&*()_+]{7,19} will match minimum 7 maximum 19 character. This is required as he presceding character class would consume a single character making the total number of characters in the string as minimum 8 and maximum 20.

  • $ Anchors the regex at the end of the string. Ensures that there is nothing following our valid password

answered Sep 18 by Roshni
• 4,630 points

Related Questions In Python

–1 vote
2 answers
0 votes
1 answer

How to create and read from a temporary file in Python?

Hi, there is a very simple solution ...READ MORE

answered Jan 29, 2019 in Python by Nymeria
• 3,520 points
361 views
0 votes
1 answer

How to create a GUID/UUID in Python

The uuid module, in Python 2.5 and ...READ MORE

answered Jan 29, 2019 in Python by SDeb
• 13,250 points
400 views
0 votes
2 answers
0 votes
1 answer

How to create a function like f(y) = xy^2 in Python?

This is very easy. have a look ...READ MORE

answered Aug 5, 2019 in Python by Neel
• 3,010 points

edited Aug 6, 2019 by Kalgi 68 views
0 votes
1 answer

How to create a zip archive of a directory in Python?

Hello @kartik, The easiest way is to use shutil.make_archive. ...READ MORE

answered May 11 in Python by Niroj
• 66,340 points
57 views
0 votes
1 answer

How to create a unicode string in python with the string eg: This is a string?

Hey, @Roshni, It is very simple to execute, ...READ MORE

answered Jun 23 in Python by Gitika
• 41,360 points
76 views
0 votes
1 answer

How to create lambda function inside a list in Python?

Hi@akhtar, The lambda statement can appear in places ...READ MORE

answered Jun 25 in Python by MD
• 65,200 points
71 views
0 votes
1 answer

How to dynamically load a module in Python?

Hi, Dynamic loading is where we do not ...READ MORE

answered Jun 26 in Python by Roshni
• 4,630 points
130 views
0 votes
1 answer

how to send post request to a webpage using cookies and headers in python to scrape the webpage ?

Hey @Avinash, Regarding your query, I would suggest ...READ MORE

answered Sep 29 in Python by Roshni
• 4,630 points
77 views