Author gdr@garethrees.org
Recipients Robert Lujo, ezio.melotti, gdr@garethrees.org, mrabarnett
Date 2017-04-04.08:03:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491292996.09.0.871584916325.issue29977@psf.upfronthosting.co.za>
In-reply-to
Content
The problem here is that both "." and "\s" match a whitespace character, and because you have the re.DOTALL flag turned on this includes "\n", and so the number of different ways in which (.|\s)* can be matched against a string is exponential in the number of whitespace characters in the string.

It is best to design your regular expression so as to limit the number of different ways it can match. Here I recommend the expression:

    /\*(?:[^*]|\*[^/])*\*/

which can match in only one way.
History
Date User Action Args
2017-04-04 08:03:16gdr@garethrees.orgsetrecipients: + gdr@garethrees.org, ezio.melotti, mrabarnett, Robert Lujo
2017-04-04 08:03:16gdr@garethrees.orgsetmessageid: <1491292996.09.0.871584916325.issue29977@psf.upfronthosting.co.za>
2017-04-04 08:03:16gdr@garethrees.orglinkissue29977 messages
2017-04-04 08:03:15gdr@garethrees.orgcreate