Hello - I am creating a text editor for source code displayed in a QPlainTextEdit. I need to position the current text cursor at a block of text that may span several lines. Is there a way to use find() to locate text with several embedded newline characters? My test case is. This is an exact match with a portion of the string in QPlainTextEdit and I can use simplify() on both strings to get a match (but then can't map back into the un-simplified string). I've tried creating a QRegularExpression with /S+ and .+ (with the dot match option enabled) and tried both find() and indexOf(). I can only match up to the first \n in the string. So I wonder if it's possible to match a multiline text? If it is possible can you give some insight on how to create the regular expression?Qt Code:
"ItemsEnableSet {\n MenuTag( 3220 )\n Enable( true )\n}"To copy to clipboard, switch view to plain text mode
Bookmarks