[EMAIL PROTECTED] wrote: > Hi Folks, > > Charlemagne will have regular expression support. Question: what > should the Jess syntax look like when you use regexes for > pattern-matching? Of course, there could be a function-based approach, > sorta like Python: > > (animal (name ?n&:(match ?n "[a-z]*"))) > > Personally I think a special operator would be nice. Perl and Ruby use > " =~ ", so that would look like > > (animal (name =~ "[a-z]*")) > > Unfortunately, Jess uses ~ to mean negation, so it's possible this > would be confusing. Another possibility would be to use "/" as > delimiters like Perl and Ruby, but no operator. > > (animal (name /[a-z]*/)) > > This last one is kind of nice, I think. > > Opinions? Other ideas? >
And for multislot binding would you allow $/[a-z]*/, meaning each value in the set has to match the regex? E.g. (animal (legs $/[a-z]*/)) or (animal (legs ?leg1 ?leg2 $/[a-z]*/)). Mihai -------------------------------------------------------------------- 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] --------------------------------------------------------------------
