import retext = '#symbol 1# / 7 - #symbol 2#'print( re.sub(r'#[^\s#](?:[^#]*[^\s#])?#', r"func('\g<0>')", text) )
Standard input is empty
func('#symbol 1#') / 7 - func('#symbol 2#')
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!