title: Regex for identifying a mergefield in an IF condition used in word
body: <p>Am able to find the megefields in a word document using the following regex</p>
  
  <pre><code>EX: &lt;&lt;SAMPLEMERGEFIELD&gt;&gt;
  
  private static readonly Regex instructionRegEx =
          new Regex(
                      @"^[\s]*MERGEFIELD[\s]+(?&lt;name&gt;[#\w]*){1}               
                          [\s]*(\\\*[\s]+(?&lt;Format&gt;[\w]*){1})?                
                          [\s]*(\\b[\s]+[""]?(?&lt;PreText&gt;[^\\]*){1})?        
                          [\s]*(\\f[\s]+[""]?(?&lt;PostText&gt;[^\\]*){1})?",
                      RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);
  </code></pre>
  
  <p>how to find the mergefield which is inside an IF condition just like this<br/></p>
  
  <pre><code>{=IF(&lt;&lt;MERGEFIELD&gt;&gt; &gt;= 100,10,0)}
  </code></pre>