-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
groupdict() returns only first character of the match if there is a single named capture group #25
Comments
I think the bug may be in this code: Lines 235 to 251 in 024bf4b
|
simonw
changed the title
finderiter() then groupdict() returns only first character of the match
groupdict() returns only first character of the match if there is a single named capture group
Jul 20, 2022
This happens without >>> rure.compile('(?P<name>\w+)').match("hello").groupdict()
{'name': 'h'}
>>> rure.compile('(?P<name>\w+)(?P<nomatch>)').match("hello").groupdict()
{'name': 'hello', 'nomatch': ''} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This line:
Returns this:
I would expect it to return this:
Adding a second named group fixes this issue for some reason:
Returns:
The text was updated successfully, but these errors were encountered: