Regular Expressions 101

Library entries

Add missing ClassVar type annotations to arbitrarily nested Python class attributes with existing annotations.

Vote

0

Regular Expression
python

"
(?P<preceeding>^(?P<whitespace>(?:[ ]{4}|\t)+)(?!self\.)(?P<attrprefix>[a-z0-9_\.]{1,})?(?P<clsattrname>[A-Z_]{1,}): )(?P<annotation>(?!ClassVar)(?:[A-Za-z0-9_]+\.*)+(?:(?:(?:\[?[A-Za-z0-9_]+(?:, | \| )?)+(?:\.{3})?)*(?:\]*))*)+(?P<remainder>.*?$[\r\n])
"
gm

Description

Loading markdown...
Submitted by jrbergen - 2 months ago