Created
July 25, 2013 19:36
-
-
Save hashar/6083022 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import re | |
text = """ | |
- bar | |
+ foo | |
- Le text est fort | |
+ Le texte est fort | |
""" | |
for m in re.finditer(r'^(?:-\s*)(.+)$', text, re.MULTILINE): | |
print m.groups() | |
# Prints: | |
# ('bar',) | |
# ('Le text est fort',) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment