I'm writing an application in which I want to base decisions partly on
whether or not attributes match regular expressions. For example, I
might want to match regular expression "Pe*er" with the fact "(town
(name Peterboro))."
so that, if I executed something like the following statements
(deftemplate town (slot name)(slot state))
(assert (town (name Peterboro)(state NH)))
(assert (town (name Paulsboro)(state NJ)))
(defrule regexp-rule
(town (name "Pe*er")(state ?st))
=>
(prinout t "The state I wanted was " ?st "." crlf))
(run)
I would get the output
"The state I wanted was NH."
I know that I can write code in Java or execute an external program
(e.g. egrep) to do this, but I would like to do it entirely within
Jess if I can.
I haven't found any clues either in the Jess Manual or in the CLIPS
books I've checked, but I may not yet know enough about CLIPS to be
looking for the right things.
Thanks!
Peter Olsen
--
Peter Olsen, PE 703-516-7304
Principal Member of Technical Staff FAX 703-528-5918
The Charles Stark Draper Laboratory SWBD 703-243-2600
1555 Wilson Boulevard, Suite 501 [EMAIL PROTECTED]
Arlington VA 22209
Scientists investigate that which already is; engineers create that which
has never been. --Albert Einstein
---------------------------------------------------------------------
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]
---------------------------------------------------------------------