Hi Lutz,
We have a "DOT" bugging around in starts-with and ends-with.. ;-)
Something realy funny is going on here...
> (starts-with "ohno!" "oh" 1)
true
> (starts-with "ohno!" "oh." 1)
true
> (starts-with "ohno!" "Yes|oh." 1)
true
> (starts-with ".ohno!" "." )
true
> (starts-with ".ohno!" "." 1)
true
> (ends-with "ohno." "." 1)
nil
> (ends-with "ohno." ".")
true
Norman.
Bug? dots in starts/ends-with
Bug? dots in starts/ends-with
-- (define? (Cornflakes))
If you are checking for a dot as the last character with a regular expression you would do:
Lutz
Code: Select all
(ends-with "ohno." "\\." 0) => true
aha oke... Then i think the documentation should be a little adjusted from the
string part on starts-with and ends-with..
because i was under the impression that only for lists the regex where possible..
and that the "....|....." was a hardcoded "or"..
but indeed this one bothers me and thats the one im fighting all day now..
> (ends-with "ohno." "." 1)
nil
Norman.
string part on starts-with and ends-with..
because i was under the impression that only for lists the regex where possible..
and that the "....|....." was a hardcoded "or"..
but indeed this one bothers me and thats the one im fighting all day now..
> (ends-with "ohno." "." 1)
nil
Norman.
-- (define? (Cornflakes))
... but there is indeed a problem, which will be fixed in 9.1.7.
As a workaround when using regex in 'ends-with' always anchor the regulare expression to the end:
now it works correctly
Lutz
As a workaround when using regex in 'ends-with' always anchor the regulare expression to the end:
Code: Select all
(ends-with "onhno." ".$" 1) => true
Lutz
if you want to detect an ending dot you really should use:
and not
which would fire on any string in xyz
The anchoring bug is fixed in 9.17.tgz but don't want to relase until the GUI stuff is done in a few days. If this is an urgent problem I can release the 9.1.7 version earlier. But including '$' at the end of the regex string really should take care of your problem.
what regex pattern are you looking for? perhaps we can help you there?
Lutz
Code: Select all
(ends-with xyz "\\.$" 0)
Code: Select all
(ends-with xyz ".$" 0)
The anchoring bug is fixed in 9.17.tgz but don't want to relase until the GUI stuff is done in a few days. If this is an urgent problem I can release the 9.1.7 version earlier. But including '$' at the end of the regex string really should take care of your problem.
what regex pattern are you looking for? perhaps we can help you there?
Lutz
you are early awake ;-)
I can life with the '." for now I do some manual cleaning on the list
every now and then... Im doing some webstatistics ;-) durrently the
list is between 150.000 and 80.000 entry's and the regex im using is
cleaning data.. its oke for now.. Ill hope to finetune and release this tool
(yes it becoming a tool ;-) in GUI format...;-)
Norman.
I can life with the '." for now I do some manual cleaning on the list
every now and then... Im doing some webstatistics ;-) durrently the
list is between 150.000 and 80.000 entry's and the regex im using is
cleaning data.. its oke for now.. Ill hope to finetune and release this tool
(yes it becoming a tool ;-) in GUI format...;-)
Norman.
-- (define? (Cornflakes))