Hi.
I'm having some trouble using QRegExp to match a multiline expression. Actually I'm trying to write a Markdown syntax highlighter, and I'd like to recognize something like:
Qt Code:
Heading 1 =========== Heading 2 -----------To copy to clipboard, switch view to plain text mode
I tried ".+\\n=+" and similar, with no success.
EDIT:
I made some attempts with the RegExp example, and I found out I should be able to use "[^\\n][\\w\\s][^\\n]+\\n=+".
The problem is that QSyntaxHighlighter::highlightBlock() is called once per line, so I can't match anything which spans more than one line. Documentation suggests using a state based highlighter, but I don't think it would work since I know if a line is an heading only when I read the next line.
Any idea how to do that (except using alternative syntax for headings off course)?
Bookmarks