[issue46627] Regex hangs indefinitely

2022-02-03 Thread Tim Peters
Tim Peters added the comment: Introducing some kind of optional timeout is too involved to just drop in without significant discussion and design effort first. If you want to pursue this, please bring it up on the python-ideas mailing list. My first take: it wouldn't really help, because

[issue46627] Regex hangs indefinitely

2022-02-03 Thread J.B. Langston
J.B. Langston added the comment: Sorry, on rereading your message I guess you were referring to the extra +, not the [^]]. The extra + after the ) was not intentional, and after removing it, the regex no longer hangs. I still think it would be nice to have a timeout setting on the regex so

[issue46627] Regex hangs indefinitely

2022-02-03 Thread J.B. Langston
J.B. Langston added the comment: Yes, it is supposed to match everything up to the closing ] in this substring: [BigTableReader(path='/data/cassandra/data/log/logEntry_202202-e68971800b2711ecaf770d5fa3f5ae87/md-112-big-Data.db')] Quoting from the re docs: To match a literal ']' inside a

[issue46627] Regex hangs indefinitely

2022-02-03 Thread Matthew Barnett
Matthew Barnett added the comment: That pattern has: (?P[^]]+)+ Is that intentional? It looks wrong to me. -- ___ Python tracker ___

[issue46627] Regex hangs indefinitely

2022-02-03 Thread J.B. Langston
New submission from J.B. Langston : The following code will cause Python's regex engine to hang apparently indefinitely: import re message = "Flushed to [BigTableReader(path='/data/cassandra/data/log/logEntry_202202-e68971800b2711ecaf770d5fa3f5ae87/md-112-big-Data.db')] (1 sstables,