[rules-users] how to write regular expressions in drools..

Nagaraju runkana runkana.nagaraju at gmail.com
Fri May 30 03:24:17 EDT 2008


HI Guys,

present i am using drools 4.0 in this case.now, i am writting some rules
validation using regular expression ZIPCODE,EMAIL,CREDIT CARD number.like
this..
--------------------
validation.dslr
--------------------
rule "email.mandatory:[insert][update][ui]"
 when
  There is an Order
  Order email address checking for first letter
then
 Reject with response : "email address must not start with @ "
end
rule "phone.mandatory:[insert][update][ui]"
when
 There is an Order
 Order phone number format should checking
 then
 Reject with response : "The phone number you entered is not valid.Please
enter a phone number with the format xxx-xxx-xxxx."\
end
-----------------------
validation.dsl
--------------------
[*][]Order email address checking for first letter= OrderBean(email matches
"@[A-Za-z0-9]*")
[*][]Order phone number format should checking=OrderBean( phone not matches
"(/\d{3}\-\d{3}\-\d{4}/)==-1)")
this rules are not working ...any one can help me.ASAP

thanks,
chanti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080530/b3a7079f/attachment.html 


More information about the rules-users mailing list