This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients ezio.melotti, jpakkane, mrabarnett, tim.peters
Date 2017-04-24.20:33:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493066036.2.0.927759594789.issue30148@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, that example takes time exponential in the number of blanks to (fail to) match - each time you add a blank to `input`, it essentially doubles the time required.

It's _possible_ for an implementation to deduce that `(\s+)+` is an insanely inefficient way to spell `\s+`, like it's _possible_ for an implementation to deduce that 10**10**10 - 10**10**10 is an insanely inefficient way to spell 0.

Python's does not.  To understand what's going on, Friedl's book "Mastering Regular Expressions" is an excellent source.
History
Date User Action Args
2017-04-24 20:33:56tim.peterssetrecipients: + tim.peters, ezio.melotti, mrabarnett, jpakkane
2017-04-24 20:33:56tim.peterssetmessageid: <1493066036.2.0.927759594789.issue30148@psf.upfronthosting.co.za>
2017-04-24 20:33:56tim.peterslinkissue30148 messages
2017-04-24 20:33:56tim.peterscreate