Bug: Regular Expressions [^\v]* not working as expected
When I use search with regular expressions, I would expect [^\v]* to match a whole line until the linebreak - but it matches the whole document. However \v works fine, as does \V - am I expecting wrong or is this a bug?
First of all, sorry for my late reply :-(
There a particularity of the BOOST Regex ligrary, about the regex syntax
\vrepresents any vertical blank character, that is to say one character which belongs to the range
[\v]represents, ONLY, the vertical tabulation character, of Unicode code
So, when you write
[^\v], it matches any single character, which is different from the
\x0b( VT character )
Thus, your regex
[^\v]*represents any set, even empty, of characters, different from the Vertical Tabulation character, included any End Of Line character (
In other words, if your current file does NOT contain any
\x0bcharacter, your regex
[^\v]*matches, absolutely, all the characters of the file. Quite logical !
\V( Uppercase v ) is equivalent to the range
[^\n\x0B\f\r], that is to say any single character, different from a Vertical Tabulation, from a Form Feed character and from an EOL character.
Again, if your file does NOT contain any
\x0ccharacter(s), the regex
\V+matches successively, each whole line, without its line break !