Subject | RE: [Firebird-Architect] Regarding the new SIMILAR TO in FB 2.5 |
---|---|
Author | Leyne, Sean |
Post date | 2008-07-18T16:12:22Z |
Dany,
SIMILAR TO functionality.
Nothing prevents you from implementing your own SIMILAR TO function via
a UDF.
handling of variables apply. There is nothing special about SIMILAR TO.
Sean
> When doing advanced work concerning language research and phoneticsI don't think it is appropriate/necessary to complicate the current
> regexps are extensively used. Amongst a plethora of advanced
> validation tasks we use regexp for manipulating strings. In this
> scenario it is extremely important not only to be able to tell if
> there is a match, but also where in the string the (first) match was
> found.
>
> Thus, in the expression
>
> 'banana' SIMILAR TO 'a+'
>
> we would need to have a return value of 2, not merely true
>
> 'banana' SIMILAR TO 'c+' could return 0.
>
> In the release notes for FB 2.5 I cannot see that this is possible.
> One could also, in order to maintain the current design, wish for an
> alternate predicate such as SIMILAR POS.
>
> Would this be possible?
SIMILAR TO functionality.
Nothing prevents you from implementing your own SIMILAR TO function via
a UDF.
> Another important thing that the release notes does not mention isThat is because as a predicate, all of the existing rules for the
> being able to use variables in PSQL on both sides of the new
> predicate(s).
handling of variables apply. There is nothing special about SIMILAR TO.
Sean