check if string is alphanumeric in python using regex code example Example: how to check if a string is composed only of alphanumeric in python String.isalnum()