I need to use Python 2 with my server. But the code below I use in my computer using Python 3, and is not working in version 2. Anyone knows the conversion of the command below to Python 2? I need to return a value in parentheses.
Python 3:
try:
new = re.search(r'\([^)]*\)', value)
new = str(new[0])
except:
return value
Python 2
????