title: Parse string using Java Regex Pattern?
body: <p>I have the below java string in the below format.</p>
  
  <pre><code>String s = "City: [name:NYK][distance:1100] [name:CLT][distance:2300] [name:KTY][distance:3540] Price:"
  </code></pre>
  
  <p>Using the java.util.regex package matter and pattern classes I have to get the output string int the following format:</p>
  
  <pre><code>Output: [NYK:1100][CLT:2300][KTY:3540]
  </code></pre>
  
  <p>Can you suggest a RegEx pattern which can help me get the above output format?</p>