Skip to content

Instantly share code, notes, and snippets.

@hisui
Created September 27, 2017 11:17
Show Gist options
  • Save hisui/4866f5843eb2fd55a97371a0dd4a355f to your computer and use it in GitHub Desktop.
Save hisui/4866f5843eb2fd55a97371a0dd4a355f to your computer and use it in GitHub Desktop.
import re
# Strong Password Detection
def is_strong_password(src):
return all(re.compile(e).search(src) for e in [
r'.{8}',
r'[a-z]',
r'[A-Z]',
r'[0-9]'
])
# Regex Version of strip()
def my_strip(src):
return re.compile(r'^\s*(.*?)\s*$').sub(r'\1', src)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment