title: Replace string that starts with specific character and ends with specific character in regular expression
body: <p>I wanted to replace a string section that starts with a specific character and ends with specific character. At below, I demonstrate test case. </p>
  
  <pre><code>var reg = /pattern/gi;
  
  var str = "asdfkadsf[xxxxx]bb";
  
  var test = str.replace(reg,"") == "asdfkadsfbb"
  
  console.log(test);
  </code></pre>