title: Modification of a Dictionary in PYTHON
body: <p>I am beginner with python. I have this following dictionary and I want to modify it to get the dictionary I require. It looks wired but you can observe keys are almost similar. </p>
  
  <pre><code> My_dict= {'AAA_h2_qqq11':[[1,3]],'AAA_h2_ppp13':[[2,3],[2,5],[2,7]],'AAA_h2_rrr12':[[3,4],[3,7]],'AAA_h3_qqq11':[[6,7]],'AAA_h3_ppp13':[[9,3],[9,8],[9,5]],'AAA_h3_rrr12':[[4,5],[4,7]]}
  </code></pre>
  
  <p>Now I want to combine 'values(which are lists in above dict)' of the similar keys which have same 'h' part. Like this. Observe first three keys. They have same 'h2' part. and last three keys have same 'h3' part. so I want to combine values of those three similar keys and put it in one big list with the key name of AAA_h2 for first three and AAA_h3 for last three. So lets make it easier. I want my resulting dictionary as follows:</p>
  
  <pre><code>  New_dict={ 'AAA_h2':[ [[1,3]], [[2,3],[2,5],[2,7]], [[3,4],[3,7]] ], 'AAA_h3': [ [[6,7]], [[9,3],[9,8],[9,5]], [[4,5],[4,7]] ] }
  
    I just want above dict but if you guys move one step forward and can do following format of same dictionary then it would be so fantastic. Just remove all those extra square brackets.   
  
     New_dict={ 'AAA_h2':[ [1,3],[2,3],[2,5],[2,7],[3,4],[3,7] ], 'AAA_h3': [ [6,7],[9,3],[9,8],[9,5],[4,5],[4,7] ] }
  
   You can use REGEX also to compare keys and then put values in list. I am okay with REGEX as well. I am familiar to it. I will greatly appreciate your help on this. Thanks ! 
  </code></pre>