title: How to use regex expression in jstl?
body: <p>I have defined a function in tld file.And it works well.But if I want to pass a parameter from the jsp,it show wrong.What's wrong with it?</p>
  
  <pre><code> public static boolean matcheTelcom(CharSequence str) { 
      public static String regTelcom="^(((153|133)\\d{8})|((1704|1707)\\d{7}))$";
       return Pattern.compile(Constant.regTelcom).matcher(str).matches();
        }
  </code></pre>
  
  <p>Now,I want to change it to this:</p>
  
  <pre><code>public static boolean matches(String pattern, CharSequence str) {
          return Pattern.compile(pattern).matcher(str).matches();
        }
  </code></pre>
  
  <p>And in the jsp,I pass it like this:</p>
  
  <pre><code> &lt;c:if test="${mapping:matches('^(((153|133)\\d{8})|((1704|1707)\\d{7}))$',data.phone)}"&gt;  
       This is a phone
    &lt;/c:if&gt;
  </code></pre>
  
  <p>The error shows:Within a quoted String only [], ['] and ["] may be escaped with [].</p>