Using REGEX to remove all characters between 2 given strings (Python 3) -
lets have string , variable,
string = '(-500)x^3' = 100
i want replace characters within brackets value of a. such string returned as,
string = '(100)x^3'
thanks!
try regex:
import re re.sub(r'\((.*)\)', r'(%s)' %s a, string)
Comments
Post a Comment