rfmonk

re_repitition.py

Dec 31st, 2013
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. from re_test_patterns import test_patterns
  4.  
  5. test_patterns(
  6.     'abbaabbba',
  7.     [('ab*',       'a followed by zero or more b'),
  8.      ('ab+',       'a followed by one or more b'),
  9.      ('ab?',       'a followed by zero or one b'),
  10.      ('ab{3}',     'a followed by three b'),
  11.      ('ab{2,3}',   'a followed by two or three b'),
  12.      ])
Advertisement
Add Comment
Please, Sign In to add comment