Skip to content

Instantly share code, notes, and snippets.

@hashar
Created July 25, 2013 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashar/6083022 to your computer and use it in GitHub Desktop.
Save hashar/6083022 to your computer and use it in GitHub Desktop.
#!/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