title: How to perform sql procedure by java using regexp as parameter in procedure?
body: <p>Fields validation parameter has  <code>^[A-Za-z\-.']*$</code> value by default in my sql database.</p>
  
  <p>I have a stored procedure which is able to change some parameter.</p>
  
  <p>I try to update this parameter with <code>^[A-Za-z0-9\-.']*$</code>.</p>
  
  <p>I try to perform the procedure with <code>CallableStatement</code>. Please see below:</p>
  
  <pre><code>String newRegexValue = "^[A-Za-z0-9\-.']*$";
  String parameterName = "ValidationParameter";
  CallableStatement callableStatement = connection.prepareCall("exec UpdateProcedure '"+parameterName  +"', '"+ newRegexValue +"' ");
  callableStatement .execute();
  </code></pre>
  
  <p>But I got SQLServerException: </p>
  
  <blockquote>
    <p>Incorrect syntax near <code>^</code></p>
  </blockquote>
  
  <p>I tried to add a backslash before <code>^</code> but error remains.</p>
  
  <p>I suppose the main problem is in screening <code>newRegexValue</code>. </p>