Closed pressureless closed 1 year ago
This is an intentional change, see https://github.com/neogeny/TatSu/blob/v5.8.3/CHANGELOG.rst#580--2022-03-12
Honor grouping in pattern expressions with the semantics of
re.findall(pattern, text)[0]
. Now groups that should not be returned when parsing should use the(?:)
syntax.
Following the change log entry:
>>> re.findall('[A-Za-z]([A-Za-z0-9]*)', 'a1')[0]
'1'
You need to modify the regular expression as follows:
>>> re.findall('[A-Za-z](?:[A-Za-z0-9]*)', 'a1')[0]
'a1'
or just drop the grouping, as it does not seem to be needed in this regular expression:
>>> re.findall('[A-Za-z][A-Za-z0-9]*', 'a1')[0]
'a1'
I saw that change, but didn't get it. Thank you for the clarification!
The output for the following code with v 5.7.3 is:
The output for the same code with v 5.8.3 is: