fork download
  1. # http://es.stackoverflow.com/q/48089/127
  2.  
  3. import re
  4.  
  5. regex = r'^[-\w]{6,}$'
  6. texto = "abc123"
  7.  
  8. if re.search(regex, texto):
  9. print('Coincide')
  10. else:
  11. print('No coincide')
Success #stdin #stdout 0.01s 9992KB
stdin
Standard input is empty
stdout
Coincide