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 yetingli
Recipients orsenthil, serhiy.storchaka, vstinner, yetingli
Date 2021-04-07.11:14:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617794068.06.0.95738793285.issue43075@roundup.psfhosted.org>
In-reply-to
Content
For a regex has polynomial worst-case complexity, limiting the maximum input length is indeed a very effective method.

As shown below, as the input length becomes smaller, the matching time becomes significantly smaller.

header = '' + ',' * (10 ** 4)    1.617s
header = '' + ',' * (10 ** 3)    0.014s
header = '' + ',' * (10 ** 2)    0.00017s
History
Date User Action Args
2021-04-07 11:14:28yetinglisetrecipients: + yetingli, orsenthil, vstinner, serhiy.storchaka
2021-04-07 11:14:28yetinglisetmessageid: <1617794068.06.0.95738793285.issue43075@roundup.psfhosted.org>
2021-04-07 11:14:28yetinglilinkissue43075 messages
2021-04-07 11:14:28yetinglicreate