Message145506
| Author |
techmaurice |
| Recipients |
brian.curtin, ezio.melotti, mrabarnett, techmaurice, vstinner |
| Date |
2011年10月14日.11:07:27 |
| SpamBayes Score |
3.8627398e-08 |
| Marked as misclassified |
No |
| Message-id |
<1318590448.37.0.0633346195508.issue13169@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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? |
|