Advertisement
here2share

# regex_morethan3consecutivedigits.py

Aug 4th, 2015
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. # regex_morethan3consecutivedigits.py
  2.  
  3. import re
  4.  
  5. def regex(test):
  6.     print bool(re.match('.*([0-9]{3,})',test))
  7. #
  8.  
  9. regex('123')
  10. regex('123abc')
  11. regex('abc123')
  12. regex('12345')
  13. regex('abc123xyz')
  14. regex('12abc3') # As should be the only False as given
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement