Used functionality is not exposed by sre_parse. As a work around version based implementation might be done in Scanner._get_group_pattern() function such as
for phrase, action in self.lexicon:
if sys.version_info >= (3, 6): # internal representation changed in 3.6, add_flags del_flags are given 0
patterns.append(sre_parse.SubPattern(sub_pattern, [
(SUBPATTERN, (len(patterns) + 1, 0, 0, sre_parse.parse(phrase, flags))), ]))
else:
patterns.append(sre_parse.SubPattern(sub_pattern, [
(SUBPATTERN, (len(patterns) + 1
, sre_parse.parse(phrase, flags))),
]))
Used functionality is not exposed by sre_parse. As a work around version based implementation might be done in Scanner._get_group_pattern() function such as