-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Description
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 hereSolution
def validate_usr(username):
return re.match('^[a-z0-9_]{4,16}$', username) != NoneMetadata
Metadata
Assignees
Labels
No labels