Advertisement
rfmonk

re_groups.py

Jan 2nd, 2014
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. from re_test_patterns import test_patterns
  5.  
  6. test_patterns(
  7.     'abbaaabbbbaaaaa',
  8.     [('a(ab)',      'a followed by literal ab'),
  9.      ('a(a*b*)',    'a followed by 0-n a and 0-n b'),
  10.      ('a(ab)*',     'a followed by 0-n ab'),
  11.      ('a(ab)+',     'a followed by 1-n ab'),
  12.      ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement