I do not know which is the layout of dashes or spaces (and quantity) into your text, but I think something like what I propose (or similar) should work, (up to 10 spaces).
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
return match.group().replace('@@','@').replace('-','@').replace('–','@').replace('—','@').replace(' @@@','@').replace('@@','@')
|