title: Regex to find some pattern in javascript
body: <p>I have a string which contains some pattern of text, and I need to find that pattern.</p>
  
  <p>For Example:</p>
  
  <pre><code>var texttochange = ' [variable field="##Menu.name##" /]&lt;br&gt;
                       [img value='##Menu.image##' width='200' height='200'
                       borderthickness='0' keepaspect='0' bordercolor='#'
                       alttext='' borderstyle='solid'][/img]&lt;br&gt;
                       [variable field="##Menu.description##" /]&lt;br&gt;
                       [variable field="##Menu.cost##" /]&lt;br&gt;';
  </code></pre>
  
  <p>And I wrote the below regex to find this pattern <code>##sometext.sometext##</code></p>
  
  <pre><code>var regexp = /##\S+.\S+##/gi;
  var matchesfound = regexp.exec(texttochange);
  </code></pre>
  
  <p>According to my requirement I need all the fields ie <code>["##Menu.name##"],["##Menu.image##"],["##Menu.description##"],["##Menu.cost##"]</code>But in the <code>var matchesfound</code>, I am only getting <code>["##Menu.name##"]</code> </p>