Is there a simple way in python to replace multiples characters by another?
For instance, I would like to change:
name1_22:3-3(+):Pos_bos >
name1_22:3-3(+):Pos_bos
You could use re.sub to replace multiple characters with one pattern:
import re s = 'name1_22:3-3(+):Pos_bos ' re.sub(r'[():]', '_', s)
Output
'name1_22_3-3_+__Pos_bos '