I need to find the string in brackets that matches some specific string and all values in the string. Right not I am getting values from a position where the string matches.
text = 'This is an sample string which have some information in brackets (info; matchingString, someotherString).'
regex= r"\(*?matchingString.*?\)"
matches = re.findall(regex, text)
From this I am getting result matchingString, someotherString) what I want is to get the string before the matching string as well. The result should be like this: (info; matchingString, someotherString) This regex works if the matching string is in the first string in brackets.