title: Problem with Javascript RegExp-mask
body: <p>I have a string that looks something like this:</p>
  
  <pre><code>{theField} &gt; YEAR (today, -3) || {theField}  &lt; YEAR (today, +3)
  </code></pre>
  
  <p>I want it to be replaced into:</p>
  
  <pre><code>{theField} &gt; " + YEAR (today, -3) + " || {theField}  &lt; " + YEAR (today, +3) + "
  </code></pre>
  
  <p>I have tried this:</p>
  
  <pre><code>String.replace(/(.*)(YEAR|MONTH|WEEK|DAY+)(.*[)]+)/g, "$1 \" + $2 $3 + \"")
  </code></pre>
  
  <p>But that gives me:</p>
  
  <pre><code>{theField} &gt; YEAR (today, +3) || {theField}  &gt;  " + YEAR  (today, +3) + "
  </code></pre>
  
  <p>Does anyone have any ideas?</p>