Regular Expression fails if newline is included
<p>I'm trying to extract a simple sentence from a string delimited with a # character.</p>

<pre><code>str = "#text text text \n text#"
</code></pre>

<p>with this pattern</p>

<pre><code>pattern = '#(.+)#'
</code></pre>

<p>now, the funny thing is that regular expression isn't matched when the string contains newline character</p>

<pre><code>out = re.findall(pattern, str) # out contains empty []
</code></pre>

<p>but if I remove \n from string it works fine.Any idea how to fix this ?</p>
