compiled regex and ends-with

Started by jopython, June 14, 2013, 06:48:30 PM

Previous topic - Next topic

jopython

Is it possible to use compiled regex with the ends-with function?



(set 'dt (regex-comp {(w+)}))

(ends-with "delta" dt 0x10000)  => ERR: regular expression in function ends-with : "error -4 when executing"


Lutz

#1
ends-with will not work with compiled regex patterns because it internally appends a $ (end of text) character to the pattern. If the pattern is already compiled that causes an error. But starts-with and others will work, as they do not change the pattern internally.



This will be added to the documentation.

jopython

#2
Thank you Lutz. newLisp has one of the best documentation for any Lisps I have seen around.