title: How to compare character ignoring case in Freemarker?
body: <p>I need to compare strings case-insensitive in <strong>Freemarker</strong> template on <em>Liferay Portal</em>.
  I tried with:</p>
  
  <pre><code>&lt;#if nav_item.getName().equalsIgnoreCase("home")&gt;
      &lt;!-- if do --&gt;
  &lt;/#if&gt;
  </code></pre>
  
  <p>But I get error: </p>
  
  <pre><code>Expected hash. nav_item.getName() evaluated instead to freemarker.template.SimpleScalar on line 39, column 46 in navigation.ftl.
  </code></pre>
  
  <p>As <a href="http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_string_flags" rel="nofollow">indicated here</a>, I can use the common flag <strong>Case insensitive</strong> to not differentiate the lower and upper-case variation of the same letter. So I tried with:</p>
  
  <pre><code>&lt;#if nav_item.getName()?matches("home", "i")&gt;
  </code></pre>
  
  <p>But does not work! I get error.<br>
  Any help is appreciated! Thank you!</p>