Hi folks !

has anyone got an idea how to implement some sort of pattern matching
in Jess ? I have thought about e.g. regular expressions or the like.
I have some lengthy error messages I need to analyze and at the moment
I´m using structures like these:

(defrule ...
(fact ... ?variable)
=>
if (eq (str-index "my pattern" ?variable) TRUE)
        (do this)
else
        (do that) )
)

But IMHO this contradicts any style guide for writing
good rules.
I think it would be a better solution to do it like this:

(defrule #1
(fact .... ?variable(*my pattern*))
=>
(do this) )

(defrule #2
(fact ...)
=>
(do that) )


Thanks in advance for any help.

CU
Norman
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to