You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the work under #9, a flaw was discovered in the re.split() function of Python.
A solution was found by a conversation with Copilot on Windows 11.
See splitproblem for some details.
The function 'split1' in test1.py provides what looks like a quite general replacement for re.split(regex,text,re.DOTALL) using re.findIter().
To see the problem,
python test1.py 5 # no problem for any number from 1 through 16.
python test1.py 17 # shows the problem. Problem occurs for inputs > 16.
The code was run with Python version 3.9.1.
I hope Python will find some way of identifying (perhaps by an exception?) when re.split(regex,text,re.DOTALL) gives THE WRONG ANSWER.
AFAIK: The problem (wrong answer) occurs when
there is a capture group in the regex
the input text has \n line breaks (number of breaks doesn't matter)
The input text matches the capture group more than 16 times.
if there are no line breaks, then re.split works fine.
The text was updated successfully, but these errors were encountered:
During the work under #9, a flaw was discovered in the re.split() function of Python.
A solution was found by a conversation with Copilot on Windows 11.
See splitproblem for some details.
The function 'split1' in test1.py provides what looks like a quite general replacement for re.split(regex,text,re.DOTALL) using re.findIter().
To see the problem,
I hope Python will find some way of identifying (perhaps by an exception?) when re.split(regex,text,re.DOTALL) gives THE WRONG ANSWER.
AFAIK: The problem (wrong answer) occurs when
\n
line breaks (number of breaks doesn't matter)The text was updated successfully, but these errors were encountered: