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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -