<p>I'm trying to add a special markup to Python documentation strings in emacs (python-mode).</p>

<p>Currently I'm able to extract a single line with:</p>

<pre><code>(font-lock-add-keywords
 'python-mode
 '(("\\(\"\\{3\\}\\.+\"\\{3\\}\\)"
    1 font-lock-doc-face prepend)))
</code></pre>

<p>This works now:</p>

<pre><code>"""Foo"""
</code></pre>

<p>But as soon there is a newline like:</p>

<pre><code>"""
Foo

"""
</code></pre>

<p>It doesn't work anymore. This is logical, since <code>.</code> doesn't include newlines (<code>\n</code>).
Should I use a character class?</p>

<p>How can I correct this regular expression to include everything between <code>""" """</code>?</p>

<p>Thanks in advance!</p>

```
```
"\\(\"\\{3\\}\\(.*\n?\\)*?\"\\{3\\}\\)"
```
```
The "*?" construct is the non-greedy version of "*".