On 3 January 2012 14:49, Swindells, Thomas <[email protected]> wrote:
> It will work
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
"customer name" field.
> Rule "Wild char validation"
> When
> c: CustomerInfo(name : customerName matches ".*([\*#].*") //any
> string containing a * or a #
>
There's a syntax error here, use ".*[*#].*", because you don't need to
quote '*' inside '[...]', and if you do (which is OK) you'll have to use
'\\'.
> then
> modify(c) {
> setCustomerName(name.replaceAll("[\*#]", "")); //replace
> any * or # with ""
> }
> end
>
Same here: either no '\' or doubled.
-W
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users