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
{{ message }}
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.
Group names must be valid Python identifiers, and each group name must be defined only once within a regular expression.
However, the following code returns no error on IronPython 2.7.7, and yields a strange value.
This code should be an error.
IronPython 2.7.7 (2.7.7.0) on .NET 4.0.30319.1 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> ptn = re.compile(r'(?P<hoge>\w+):(?P<hoge>\w+)')
>>> ptn.match('hoge:fuga')
<RE_Match object at 0x000000000000006D>
>>> _.group('hoge')
'fuga'
The text was updated successfully, but these errors were encountered:
The duplication of symbolic group names on regular expression is prohibited on CPython's
re
module.https://docs.python.org/2/library/re.html#regular-expression-syntax
However, the following code returns no error on IronPython 2.7.7, and yields a strange value.
This code should be an error.
The text was updated successfully, but these errors were encountered: