Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New kata-56a3f08aa9a6cc9b75000023 #6

Open
DavidAdamsDesign opened this issue Aug 29, 2022 · 1 comment
Open

New kata-56a3f08aa9a6cc9b75000023 #6

DavidAdamsDesign opened this issue Aug 29, 2022 · 1 comment

Comments

@DavidAdamsDesign
Copy link

CodeWars Python Solutions


Simple validation of a username with regex

Write a simple regex to validate a username. Allowed characters are:

  • lowercase letters,
  • numbers,
  • underscore

Length should be between 4 and 16 characters (both included).


Given Code

def validate_usr(username):
    #your code here

Solution

def validate_usr(username):
  return re.match('^[a-z0-9_]{4,16}$', username) != None

See on CodeWars.com

@DavidAdamsDesign
Copy link
Author

8kyuKatas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant