-
-
Notifications
You must be signed in to change notification settings - Fork 645
Closed
Description
Reported by wjp: The following is an example from the python regular expression howto. It seems that ipython's preprocessing somehow gets in the way. This works perfectly fine with regular python:
[wjp@issa sage-2.8.12]$ ./sage
----------------------------------------------------------------------
| SAGE Version 2.8.12, Release Date: 2007-11-06 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: import re
sage: >>> p = re.compile('(a(b)c)d')
sage: >>> m = p.match('abcd')
sage: >>> m.group(0)
---------------------------------------------------------------------------
<type 'exceptions.IndexError'> Traceback (most recent call last)
/data/sage/sage-2.8.12/<ipython console> in <module>()
<type 'exceptions.IndexError'>: no such group
sage: type(m)
<type '_sre.SRE_Match'>
sage: m.groups()
('abc', 'b')
sage:
Cheers,
Michael
Component: packages: standard
Issue created by migration from https://trac.sagemath.org/ticket/1142