QRegExp uses the Unicode "separator" category for \s
. This includes \v
.
QRegularExpression is a wrapper around PCRE, where the documentation states (http://pcre.org/pcre.txt):
For compatibility with Perl, \s does not match the VT character (code 11). This makes it different from the the POSIX "space" class. The \s characters are HT (9), LF (10), FF (12), CR (13), and space (32). If "use locale;" is included in a Perl script, \s may match the VT charac- ter. In PCRE, it never does.
Although the documentation says it never matches \v
, you could try passing the UseUnicodePropertiesOption
option to the QRegularExpression, which changes the character classes to use the Unicode properties, so in theory, unless a specific exception is built into PCRE, \s
should match \v
.
Failing that, you can use (\h|\v)
(in C++ string form that's "(\\h|\\v)"
), using PCRE's special "horizontal space" and "vertical space" classes.