The regex isn't capturing function bodies correctly. https://regex101.com/r/7Cm7PV/1 continue to experiment here