title: Regular expression to remove special characters in JSTL tags
body: <p>I am working on a Spring application and in JSPX page I need to dynamically load some values from properties page and set them as dropdown using  options tag. I need to use same text for options value and for displaying but for options value, I need to remove all special characters. </p>
  
  <p>For example if value is Maternal Uncle, then I need </p>
  
  <pre><code>&lt;option value="MaternalUncle"&gt;Maternal Uncle&lt;/option&gt;
  </code></pre>
  
  <p>What I am getting is </p>
  
  <pre><code>&lt;option value="Maternal Uncle"&gt;Maternal Uncle&lt;/option&gt;
  </code></pre>
  
  <p>There are 2 applications which can use that page and which properties file to load depends on app. If I load values for app 1 then values get displayed properly, Last value in app1 is 'Others' and does not has any special characters. For app 2 it does not trims whitespaces where last value is 'Maternal Uncle'. repOptions in code is ArrayList with values loaded from properties file. Here is my code:</p>
  
  <pre><code>&lt;select name="person" id="person"&gt;
        &lt;option value="na"&gt;Select the relationship&lt;/option&gt;
    &lt;c:forEach items="${repOptions}" var="repOption"&gt;
         &lt;option value="${fn:replace(repOption, '[^A-Za-z]','')}"&gt;${repOption}&lt;/option&gt;
    &lt;/c:forEach&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>First app removes whitespaces as this value is 4th in list of 9. For app2 , this is last value and regex does not works. If I put Maternal Uncle as first property for app2 then this works fine but requirements is to have it last option.</p>
  
  <pre><code> &lt;option value="${fn:replace(repOption, ' ','')}"&gt;
  </code></pre>
  
  <p>is working for whitespaces but there can be values like Brother/Sister, so I need to remove / also, hence I am using regex.</p>