Details
-
Task
-
Resolution: Done
-
P4: Low
-
None
-
None
-
Qt documentation
Description
The documentation page for QRegExp says at multiple points that newline (\n) and return (\r) are recognized and are found as part of whitespace (\s). This is misleading because QTextDocument::find cannot match a regexp across a block boundary (see this forum post:http://developer.nokia.forums.com/viewthread/6665). Hence you cannot get a match to any \n in a QPlainTextEdit at all, either as \n or as \s; and you cannot get a match to any pattern when the target spans two or more lines. For instance, the example in QRegExp of searching for <i>-markup can only work when the open and closing markup are both on a single line. In a QTextEdit, you cannot get a match that spans paragraphs. This restriction is unrelated to the use of minimal or regexp2 syntax.
Attachments
For Gerrit Dashboard: QTBUG-21785 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
121482,2 | Clarified the documentation for QTextDocument::find. | dev | qt/qtbase | Status: MERGED | +2 | 0 |