Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-21785

QTextDocument documentation does not explain restrictions on newline search

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P4: Low
    • 5.6.0 RC
    • None
    • Documentation
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kavindra Kavindra Palaraja (Inactive)
            dcortesi David Cortesi
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified

                Gerrit Reviews

                  There are no open Gerrit changes