Conn path

I think the logic seems good here but it's getting fairly obscured. Wondering of the regexp is covering too many cases now given we need this extra logic to construct the return value depending on which submatches are populated.
Might be worth considering spiting the regexp up into 2 or 3 cases then the logic is perhaps clearer..
if { regexp1 } {
 return result1
}
if { regexp2 } {
 return result2
}
...