How to make exceptions for certain words in regex
<p>I'm very new in programming and regex so apologise if this's been asked before (I didn't find one, though). </p>

<p>I want to use Python to summarise word frequencies in a literal text. Let's assume the text is formatted like </p>

<pre><code>Chapter 1
blah blah blah

Chapter 2
blah blah blah
....
</code></pre>

<p>Now I read the text as a string, and I want to use <code>re.findall</code> to get every word in this text, so my code is</p>

<pre><code>wordlist = re.findall(r'\b\w+\b', text)
</code></pre>

<p>But the problem is that it matches all these <code>Chapter</code>s in each chapter title, which I don't want to include in my stats. So I want to ignore what matches <code>Chapter\s*\d+</code>. What should I do?</p>

<p>Thanks in advance, guys. </p>