#NEWLINE# def increase_regex_replacements_group_positions( replacement , increment ) : #NEWLINE# #INDENT# splitted = GROUPS_REGEX . split ( replacement ) #NEWLINE# for i in range ( 1 , len ( splitted ) , 2 ) : #NEWLINE# #INDENT# group = splitted [ i ] #NEWLINE# if group . isdigit ( ) : #NEWLINE# #INDENT# splitted [ i ] = str ( ( int ( group ) + replacement ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# splitted [ i ] = 'g<{}>' . format ( ( int ( G_REGEX . match ( group ) . group ( 1 ) ) + increment ) ) #NEWLINE# #UNINDENT# #UNINDENT# return '' . join ( splitted )