I'm trying to add a special markup to Python documentation strings in emacs (python-mode).
Currently I'm able to extract a single line with:
(font-lock-add-keywords
'python-mode
'(("\\(\"\\{3\\}\\.+\"\\{3\\}\\)"
1 font-lock-doc-face prepend)))
This works now:
"""Foo"""
But as soon there is a newline like:
"""
Foo
"""
It doesn't work anymore. This is logical, since .
doesn't include newlines (\n
).
Should I use a character class?
How can I correct this regular expression to include everything between """ """
?
Thanks in advance!