python : re

# 패턴
pattern = r'(void my_function\(int )(\w+)(\);)'
 
# 교체
re.sub(pattern, r'\1new_param\3', text)
패턴 의미
() 캡쳐그룹
\g<0> 전체매치
\1, \2, … 또는 \g<1>, \g<2> 캡처된 부분 그룹