Item2028: Character classes in regex SEARCH broken
Priority: Enhancement
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: SEARCH
Branches:
The regex syntax for
%SEARCH%
is not implemented properly. I found at least two character classes which don't work as expected:
\w
and
\s
.
The example below illustrates the problem. The twi lines of text define the search target. The first search uses
[a-z]+
and works as expected. The second search uses
[\w]+
which should find the same but fails. In the third example, the white-space in the regex is written as a literal (" ") which works. If the white-space in the regex is replaced by
\s
, the search fails (4th search).
Under TWiki 4.1.2 all of these examples work as expected.
Search Target
footextbar
spam and some more text
1st Search
Number of topics: 1
2nd Search
Number of topics: 1
3rd Search
Number of topics: 1
4th Search
Number of topics: 1
--
MartinKaufmann
confirmed (painfully) that
\s
and such don't work. not confirmed in the sense that i don't know it was ever spec'ed to wok... :/ confirming, but changing to an enhancement until/unless there's documentation to point at saying this is supposed to work or was ever implemented.
--
WillNorris - 15 Feb 2010
I haven't come across any documentation either. I can only show some screenshots taken on my old TWiki® 4.1.2 installation.
- Character class
\s
:
- Character class
\w
:
--
MartinKaufmann - 15 Feb 2010