You are viewing a single comment's thread. Return to all comments →
\1 means the literal value of the value matched in the first group. The + sign right after that means "one or more" of those.
\1
+
In that sense, the whole expression reads as "an alphanumeric character that is followed by one or more characteres that are identical to it"
That is very clever, as I did not realize "\1" could be used inside the matching expression.
For reference: https://docs.python.org/3/library/re.html
Seems like cookies are disabled on this browser, please enable them to open this website
Group(), Groups() & Groupdict()
You are viewing a single comment's thread. Return to all comments →
\1
means the literal value of the value matched in the first group. The+
sign right after that means "one or more" of those.In that sense, the whole expression reads as "an alphanumeric character that is followed by one or more characteres that are identical to it"
That is very clever, as I did not realize "\1" could be used inside the matching expression.
For reference: https://docs.python.org/3/library/re.html