Changing wildmat syntax
Posted: Thu Jul 13, 2006 6:02 am
I'm thinking about changing wildmat syntax a little, some users were asking me to make searches more intuitive.
I've added one additional seamless special character here already to look for whole words without the set operator, the change to be in effect in the next release, but the question is whether to go for more.
Basically the difference would be to replace [...] with {...} like {0-1} or {^a-z} plus backslash can be used as "match the next character directly" only for special characters and not for any character.
The reason is square brackets appear almost in every subject and curly brackets appear in about 0.5% of subjects only. Also no problem with the negation symbol ^ it is used only in 0.08% of subjects.
If I go for it I'll add a selected topic with examples of search/filter expressions, the idea is that if you even don't know what wildmats are and use the modified wildmats as wildcards it will still work in 99.5% of cases.
Just several days ago I noticed that the standard wildmat implementation has a bug (so it is the case with xpat searches on every server since the standard implementation is used on the server side) so when the pattern is [^a-z]... and the match is in the beginning of the string or pattern is ...[^a-z] and the match is in the end of the string the result will be "no match" although it should be clearly "match", I fixed that, but then I started thinking about further improvements so to make the search/filter syntax more intuitive.
So most users won't notice the change at all, only if someone used square brackets - curly brackets are to be used instead.
I've added one additional seamless special character here already to look for whole words without the set operator, the change to be in effect in the next release, but the question is whether to go for more.
Basically the difference would be to replace [...] with {...} like {0-1} or {^a-z} plus backslash can be used as "match the next character directly" only for special characters and not for any character.
The reason is square brackets appear almost in every subject and curly brackets appear in about 0.5% of subjects only. Also no problem with the negation symbol ^ it is used only in 0.08% of subjects.
If I go for it I'll add a selected topic with examples of search/filter expressions, the idea is that if you even don't know what wildmats are and use the modified wildmats as wildcards it will still work in 99.5% of cases.
Just several days ago I noticed that the standard wildmat implementation has a bug (so it is the case with xpat searches on every server since the standard implementation is used on the server side) so when the pattern is [^a-z]... and the match is in the beginning of the string or pattern is ...[^a-z] and the match is in the end of the string the result will be "no match" although it should be clearly "match", I fixed that, but then I started thinking about further improvements so to make the search/filter syntax more intuitive.
So most users won't notice the change at all, only if someone used square brackets - curly brackets are to be used instead.