On 3 January 2012 14:49, Swindells, Thomas <span dir="ltr">&lt;<a href="mailto:TSwindells@nds.com" target="_blank">TSwindells@nds.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">

It will work</blockquote><div><br>Not the way it was posted. At least, StringBuffer.setCharAt() needs a second argument of type char, and this would be a strange type for a &quot;customer name&quot; field.<br><br> <br></div>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">

Rule &quot;Wild char validation&quot;<br>
When<br>
        c: CustomerInfo(name : customerName matches &quot;.*([\*#].*&quot;) //any string containing a * or a #<br></blockquote><div><br>There&#39;s  a syntax error here, use &quot;.*[*#].*&quot;, because you don&#39;t need to quote &#39;*&#39; inside &#39;[...]&#39;, and if you do (which is OK) you&#39;ll have to use &#39;\\&#39;.<br>

 </div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
then<br>
        modify(c) {<br>
                setCustomerName(name.replaceAll(&quot;[\*#]&quot;, &quot;&quot;)); //replace any * or # with &quot;&quot;<br>
        }<br>
end<br></blockquote><div><br>Same here: either no &#39;\&#39; or doubled.<br> <br>-W<br><br><br>
</div></div>