You need a non-greedy Regex to match the first []from the beginning, and re.subto replace:
In [10]: title = "[test][R] D123/Peace123456: panic:"
In [11]: re.sub(r'^\[[^]]*\]', '', title)
Out[11]: '[R] D123/Peace123456: panic:'
In [12]: re.sub(r'^\[.*?\]', '', title)
Out[12]: '[R] D123/Peace123456: panic:'
source
share