Skip to content

Instantly share code, notes, and snippets.

@jedie
Created August 15, 2011 13:58
Show Gist options
  • Save jedie/1146809 to your computer and use it in GitHub Desktop.
Save jedie/1146809 to your computer and use it in GitHub Desktop.
re diff: pypy <-> ypython
import re
link = re.compile(
r'''(?P<link>
\[\[
(?P<link_target>.+?) \s*
([|] \s* (?P<link_text>.+?) \s*)?
]]
)''', re.VERBOSE | re.UNICODE
)
def test(match):
print match.groupdict()
link.sub(test, "1 [[internal links|link text]] test.")
# PyPy (pypy-c-jit-43780-b590cf6de419-linux64) output:
{'link_target': 'internal links|link text', 'link': '[[internal links|link text]]', 'link_text': None}
# CPython output:
{'link_target': 'internal links', 'link': '[[internal links|link text]]', 'link_text': 'link text'}
@jedie
Copy link
Author

jedie commented Aug 15, 2011

fixes in PyPy nightly build ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment