Tim Peters <t...@python.org> added the comment:

Note:  if you found a regexp like this _in_ the Python distribution, then a bug 
report would be appropriate.  It's certainly possible to write regexps that can 
suffer catastrophic backtracking, and we've repaired a few of those, over the 
years, that shipped with Python.

But we can't stop you from writing such things yourself.  If you post your 
regexp to, e.g., comp.lang.python or StackOverflow, I'm sure someone will show 
you how to rewrite it in a safe way.  But be prepared to explain in English 
what you're trying to accomplish with it.

For example, while it appears you're trying to ensure there are at least 3 
characters (of the right kind) between "|" separators, for some reason you made 
matching "|" optional.  That leaves open an exponential number of ways to try 
to match long strings of non-"|" characters between "|" separators.

----------
nosy: +tim.peters

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33113>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to