Advertisement
bl00dt3ars

01. Valid Usernames

Aug 9th, 2021
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. import re
  2.  
  3. usernames = input().split(", ")
  4. pattern=r"[^A-Za-z0-9\-\_]"
  5.  
  6. for username in usernames:
  7.     if 3 <= len(username) <= 16:
  8.         match=re.findall(pattern,username)
  9.         if not match:
  10.             print(username)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement