Message145506
So if I understand correctly, the maximum of 65535 repetitions is by design?
Have tried a workaround by repeating the repetitions by placing it inside a capturing group, which is perfectly legal with Perl regular expressions:
$mystring = "test";
if($mystring =~ m/^(.{0,32766}){0,3}test/s) { print "Yes\n"; }
(32766 being the max repetitions in Perl)
Unfortunately, in Python this does not work and raises a "nothing to repeat" sre_constants error:
re.search('(?s)\A(.{0,65535}){0,3}test', 'test')
This, however works, which yields 65536 repetitions of DOTALL:
re.search('(?s)\A.{0,65535}.{0,1}test', 'test')
In the end this solves my problem sort or less, but requires extra logic in my script and complicates stuff unnecessary.
A suggestion might be to make repetitions of repeats possible? |
|
| Date |
User |
Action |
Args |
| 2011-10-14 11:07:28 | techmaurice | set | recipients:
+ techmaurice, vstinner, ezio.melotti, mrabarnett, brian.curtin |
| 2011-10-14 11:07:28 | techmaurice | set | messageid: <1318590448.37.0.0633346195508.issue13169@psf.upfronthosting.co.za> |
| 2011-10-14 11:07:27 | techmaurice | link | issue13169 messages |
| 2011-10-14 11:07:27 | techmaurice | create | |
|