i would like to perform regex matching, but exclude from the result the characters used for the matching. consider this sample code
import re
string="15 83(B): D17"
result=re.findall(r'\(.+\)',string)
print(result)
here's what i get: ['(B)']
here's what i'd like to have: ['B']
i'm after a generic solution to exclude pattern characters used to start/end a match from the result, not just a solution for this precise case. for example instead of just ( and ) i could have used more complex patterns to start/end matching, and i still would not want to see them as part of the result.