I have a list in python consisting of a single element, which is a tree written in Newick Format, as shown below:
['(BMNH833953:0.16529463651919140688,(((BMNH833883:0.22945757727367316336,(BMNH724182a:0.18028180766761139897,(BMNH724182b:0.21469677818346077913,BMNH724082:0.54350916483644962085):0.00654573856803835914):0.04530853441176059537):0.02416511342888815264,(((BMNH794142:0.21236619242575086042,(BMNH743008:0.13421900772403019819,BMNH724591:0.14957653992840658219):0.02592135486124686958):0.02477670174791116522,BMNH703458a:0.22983459269245612444):0.00000328449424529074,BMNH703458b:0.29776257618061197086):0.09881729077887969892):0.02257522897558370684,BMNH833928:0.21599133163597591945):0.02365043128986757739,BMNH724053:0.16069861523756587274):0.0;']
In tree format, it looks like this:

I'm trying to write some code that will look at a list item and return identifiers (BMNHxxxxxx) that are connected by a branch length of 0 (or, for example, <0.001) (highlighted in red). I was thinking about using regex, like this:
JustTree = []
with JustTree as f:
for match in re.finditer(r"(?<=Item\sA)(?:(?!Item\sB).){50,}", subject, re.I):
f.extend(match.group()+"\n")
StackOverflow, A ":", a: B ",", ")" ";"; , , Im , .
0, , ['BMNH703458a', 'BMNH703458b']. , , , 0,01, .
- - , .