title: regular expression to replaceall substrings embedded in open curling brackets and followed by equal sign and digits
body: <p>In the follwing String</p>
  
  <pre><code>String toBeFormatted= "[[LngLatAlt{longitude=-7.125924901999952, latitude=33.831783175000055, altitude=NaN},
   LngLatAlt{longitude=-5.401396163999948, latitude=35.92213140900003, altitude=NaN}]]"
  </code></pre>
  
  <p>1- I need to replace all "LngLatAlt{longitude=" <strong>with open bracket "["</strong></p>
  
  <p>2- also need to replace all the intermediate ", latitude=33.831783175000055, altitude=NaN}" <strong>with ",33.831783175000055]"</strong></p>
  
  <p>That way my string result :</p>
  
  <pre><code>"[[[-7.125924901999952,33.831783175000055],[-5.401396163999948,35.92213140900003]]]"
  </code></pre>
  
  <p>try it the following reg exp :</p>
  
  <pre><code>        String regexTarget = "(\\[\\[LngLatAlt\\{longitude=)";
          toBeFormatted.replaceAll(regexTarget, "\\[\\[\\[");
          String regexTarget0 = "(, altitude=NaN\\}, LngLatAlt\\{longitude=)";
          toBeFormatted.replaceAll(regexTarget0, "],\\[");
          String regexTarget1 = "(, latitude=)";
          toBeFormatted.replaceAll(regexTarget1, " ,");
          String regexTarget2 = "(, altitude=NaN\\})";
          toBeFormatted.replaceAll(regexTarget2, "]");
  </code></pre>
  
  <p>but it seems not working.</p>
  
  <p>Thank you for your help.</p>