Advertisement
rfmonk

EX_re_groups_named.py

Jan 2nd, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. """ exception thrown on re_groups_named.py
  2. [Pymode] Found errors and warnings: 0
  3. rfmonk@trotsky
  4. ~/Python $ python re_groups_named.py
  5. This is some text -- with punctuation.
  6.  
  7. Matching "^(?P<first_word>\w+)"
  8.   ('This',)
  9.   {'first_word': 'This'}
  10.  
  11. Matching "(?P<last_word>\w+)\S*$"
  12.   ('punctuation',)
  13.   {'last_word': 'punctuation'}
  14.  
  15. Matching "(?P<t_word>\bt\w+)\W(?P<other_word>\w+)"
  16.  
  17. Traceback (most recent call last):
  18.  File "re_groups_named.py", line 19, in <module>
  19.    print '  ', match.groups()
  20. AttributeError: 'NoneType' object has no attribute 'groups'
  21. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement