I am fetching and looping on strings which can have one brackets or multiple as shown below. I want the strings inside the last bracket.
strOne = "This contains (18xp) (23lo) (SerialA)"
strTwo = "This contains (jxp) (SerialB)"
strThree = "Some strings (randomA9)"
regFormat = '(\([A-Z0-9]+\))'
pathReg = re.compile(regFormat)
findr = re.findall(pathReg , strOne)
You have to use a regexp signs indicating the start and the end of the line.