You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In QRegExpr \s refers to QChar::isSpace, which says that a space can be:
* QChar::Separator_Space => [Unicode class name Zs][Zs]
- U+0020 SPACE
- U+00A0 NO-BREAK SPACE
- and 15 more codes that cannot occur in G codes
* QChar::Separator_Line => [Unicode class name Zl][Zl]
- U+2028 LINE SEPARATOR
* QChar::Separator_Paragraph => [Unicode class name Zp][Zp]
- U+2029 PARAGRAPH SEPARATOR
Thus, for G codes in QRegExpr \s is equal to U+0020.
QRegularExpression follows the [Perl specification][PS], where \s can be:
* U+0009 CHARACTER TABULATION
* U+000A LINE FEED
* U+000B LINE TABULATION
* U+000C FORM FEED
* U+000D CARRIAGE RETURN
* U+0020 SPACE
* U+0085 NEXT LINE
* U+200E LEFT-TO-RIGHT MARK
* U+200F RIGHT-TO-LEFT MARK
* U+2028 LINE SEPARATOR
* U+2029 PARAGRAPH SEPARATOR
Therefore, "\s" is replaced by " \t".
[Zs]: https://www.fileformat.info/info/unicode/category/Zs/list.htm
[Zl]: https://www.fileformat.info/info/unicode/category/Zl/list.htm
[Zp]: https://www.fileformat.info/info/unicode/category/Zp/list.htm
[PS]: https://perldoc.perl.org/perlre#Details-on-some-modifiers
0 commit comments