Jess doesn't include regular expression matching. It'd be easy to
build a set of userfunctions around the gnu.regex package, though, for
example, if you really needed it. See http://www.cacas.org/~wes/java/,
the home page for gnu.regex.
For the examples below, though, you don't need regular expressions;
perhaps if your needs aren't more complex than this then all you need
is to use a bit of reflection to invoke the primitive matching
capabilities of the Java String class.
(defrule stewar-names
(person (last-name ?n&:(call ?n startsWith "stewar")))
=>
(printout t "?n "starts with 'stewar'" crlf))
I think Bob Stewart wrote:
> Hi,
>
> I am looking to be able to match patterns
> using wildcards. Example- I want to have a
> rule that will match area code and exchange
> of telephone numbers. ie: 410 442 xxxx such
> that when I assert 4104421234 or 41044200
> a rule will fire.
> Or a rule that will match a name- ie:
> stewar* will match stewart, steward, or stewartson.
>
> I am not all that familiar with regex, so any
> examples/samples would be appreciated.
> Note: I am running java1.3, so I do not have
> access to the new stuff in 1.4
>
> Thanks,
> Bob Stewart
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------