I'd like to replace quantities with name then a square bracket and a single quote with the contents inside. So, from this:
RSQ(name['BAKD DK'], name['A DKJ'])
to this:
RSQ(BAKD DK, A DKJ)
I'd like to replace quantities with name then a square bracket and a single quote with the contents inside. So, from this:
RSQ(name['BAKD DK'], name['A DKJ'])
to this:
RSQ(BAKD DK, A DKJ)
Code -
import re
s = "RSQ(name['BAKD DK'], name['A DKJ'])"
expr = r"[\'\[\]]|\bname\b"
print(re.sub(expr, '', s))
Output -
RSQ(BAKD DK, A DKJ)