LIKE Operator

Mar 11, 2008 at 3:16 PM
Does FLEE support LIKE operator? If not then is there any way we can implement it?
Mar 12, 2008 at 1:52 AM
There isn't one right now.

I think if I were to implement one, it would use regular expressions instead of the more limited LIKE syntax (which can be replicated with regexes anyways).

So you could write an expression like: stringVar LIKE ".*\.txt$" to return true if stringVar ends with ".txt".

Sounds good?
Mar 12, 2008 at 1:09 PM
If there is no overload or performance penalty for those that are not going to use "LIKE" in our expressions, it sounds very good. The problem could be to deal with RegEx options (ignore case...). Maybe it is easier to import RegEx and call its static method IsMatch()?
Mar 12, 2008 at 1:09 PM
Edited Mar 12, 2008 at 1:09 PM
(deleted, it was dupped)
Mar 13, 2008 at 9:22 PM
@nimittdesai: Like fernando said, you can achieve something similar to LIKE by importing the IsMatch method of the RegEx class and passing in the appropriate regular expression.

@fernando: A LIKE operator would just be some syntactic sugar for the IsMatch method. The RegExOptions would be put in the ExpressionOptions class and passed to the IsMatch method when the expression is evaluated.
Apr 4, 2008 at 8:21 PM
Regex use can be taxing on performance. For now I just implemented a custom function with indexof method.