Based on the screenshot, you are only interested in quotes spanning multiple lines. Here's a patten for that:
"\\(``\\(?:[^'\n]\\|'[^'\n]\\)*'?\\)\n\\(?:.\\|\n\\)*?''"
Or in rx
syntax:
(rx (seq (group "``" (zero-or-more (or (not (in "\n'"))
(seq "'" (not (in "\n'")))))
(zero-or-one "'"))
"\n" (minimal-match (zero-or-more anything)) "''"))
Note that we handle single '
characters with this:
"\\(?:[^'\n]\\|'[^'\n]\\)*'?
Which says match zero-or-more repetitions of:
- Any single character which is neither
'
nor a newline. - A
'
character followed by any single character which is neither'
nor a newline.
Followed optionally by a single '
immediately before the newline.
Group 1 is the part to highlight. e.g. with hi-lock-mode
:
Hi-lock: (("\\(``\\(?:[^'\n]\\|'[^'\n]\\)*'?\\)\n\\(?:.\\|\n\\)*?''"
(1 (quote hi-green-b) prepend)))