Given a string:
#symbol 1# / 7 - #symbol 2#
I want to return:
func('#symbol 1#') / 7 - func('#symbol 2#')
I've tried:
re.sub('[#*#]', 'func(\'', f2)
which gives:
func(symbol 1func( / 7 - func(symbol 2func(
where I don't want the func(' for the second hash.
Is there a way to get the end of the hash replaced with ') using the re.sub?