Opened 7 years ago

Last modified 6 years ago

#20750 closed defect

Fix re group indexing with Sage Integers — at Initial Version

Reported by: Jeroen Demeyer Owned by:
Priority: major Milestone: sage-7.3
Component: packages: standard Keywords:
Cc: John Palmieri Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

This breaks:

sage: import re
sage: p = re.compile('(a)b')
sage: m = p.match('ab')
sage: m.group(0)
IndexError: no such group

The reason is that the re module does not handle Sage Integers:

sage: m.group(int(0))
'ab'

Change History (0)

Note: See TracTickets for help on using tickets.