re.compile problem #268

Open
pyjsorg opened this Issue Apr 27, 2012 · 2 comments

Comments

Projects
None yet
1 participant
Contributor

pyjsorg commented Apr 27, 2012

The combination of an re.compile()'d object with re.match() or re.search() doesn't seem to work properly.

:: Problematic Code ::
from pyjamas import Window
import re

pattern = re.compile(r'a(bc)')
value = re.match(pattern, r'abc').group(1)
Window.alert(value)

:: Expected ::
import re

pattern = re.compile(r'a(bc)')
value = re.match(pattern, r'abc').group(1)
print value

...prints "bc" with Python 2.6.5 on Arch Linux.

:: Firebug error message (Firefox 3.6.3) ::
Module re at line 67 :
TypeError: x.mro is undefined
test1.py, line 5:
value = re.match(pattern, r'abc').group(1)
re.py, line 19:
return compile(pattern, flags).match(string)
re.py, line 67:
return SRE_Pattern(pattern, flags, compile(pattern, flags))
re.py, line 168:
spat = r"([\s\S]
?)(" + pat + r")[\s\S]_"

Using git commit ef882e6 (July 8, 2010).
Tried building with "pyjsbuild -d <file.py>".

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=451 (July 10, 2010 05:46:37)

Contributor

pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on July 15, 2010 18:29:14:
david, hi, thank you for this. could you possibly create an example for LibTest out of this, referencing "#451" in the comment as self.assert(....., "bug #451")

Contributor

pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on September 23, 2010 13:00:01:
david, hi, how you getting on creating that libtest example?
tia,
l.

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