I have a string as follows:
course_name = \"Post Graduate Certificate Programme in Retail Management (PGCPRM) (Online)\"
I want to extract only
To extract value within first parenthesis
>>> course_name = "Post Graduate Certificate Programme in Retail Management (PGCPRM) (Online)"
>>> x = re.search(r'\(.*?\)',course_name).group()
>>> x
'(PGCPRM)'
And then to replace
>>> course_name.replace(x,'')
'Post Graduate Certificate Programme in Retail Management (Online)'