regex - Check if a string has atleast 3 alpha numeric characters in python -
how find if string has atleast 3 alpha numeric characters in python. i'm using regex "^.*[a-za-z0-9]{3, }.*$"
, throws error message everytime.
my example string: a&b#cdg1. p
lease let me know.
you can try this:
len(re.sub('\w', '', "a&b#cdg1"))
as continuous string @ least 3 alpha numeric characters, can use regex pattern
'[a-za-z0-9]{3,}'
Comments
Post a Comment