Advertisement
rfmonk

re_escape_codes.py

Jan 2nd, 2014
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. from re_test_patterns import test_patterns
  5.  
  6. test_patterns(
  7.     'A prime #1 example!',
  8.     [(r'\d+',   'sequence of digits'),
  9.      (r'\D+',   'sequence of nondigits'),
  10.      (r'\s+',   'sequence of whitepace'),
  11.      (r'\S+',   'sequence of nonwhitespace'),
  12.      (r'\w+',   'alphanumeric characters'),
  13.      (r'\W+',   'nonalphanumeric'),
  14.      ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement