I am looking to match a string that is inputted from a website to check if is alpha-numeric and possibly contains an underscore. My code:
if re.match(\'[a-zA
Your regex only matches one character. Try this instead:
if re.match('^[a-zA-Z0-9_]+$',playerName):