title: Split the following list into 4 elements using TCL
body: <p>How Do I split the following list into 4 elements using TCL</p>
  
  <p>W.1.Agg-251::ethernet17/24 Z.1.Acc-2::ethernet17/1</p>
  
  <p>I tried as below , But the middle two elements looks to be sticking together ,</p>
  
  <p>set c [split $c ::]
  {\ W.1.Agg-251 {} {ethernet17/24 Z.1.Acc-2} {} ethernet17/1}</p>
  
  <p>Update:</p>
  
  <p>The solution provided below does work if I pass the list as it is , but when i pass it as a variable liek below , again I see the middle elements are stuck together . </p>
  
  <p>Like so :</p>
  
  <pre><code> set list2 [lindex $list 0]
  </code></pre>
  
  <p>o/p==>     W.1.Agg-251::ethernet17/24 Z.1.Acc-2::ethernet17/1</p>
  
  <pre><code> set list3 [split [string map {:: :} $list2] ":" ]
  </code></pre>
  
  <p>o/p==>     { W.1.Agg-251} {ethernet17/24 Z.1.Acc-2} ethernet17/1</p>