Match number between '<<' (regex)
<p>I have the following string</p>

<blockquote>
  <p>All files          |  100 &lt;&lt;222>></p>
</blockquote>

<p>And would like to match the number between <code>&lt;&lt; &gt;&gt;</code></p>

<p>How can I do that? </p>

<p>So far I tried this expression <code>(?&lt;&lt;)(.*?)(?&gt;&gt;)</code></p>

<p>The problem is, that <code>&lt;</code> is a special character, which needs to be escaped. Also, the <code>?</code> in the first and third group are invalid:</p>

<pre><code>(\&lt;\&lt;)(?P&lt;number&gt;\d*?)(\&gt;\&gt;)
</code></pre>

<p>Additionally, I named the group with the number and used <code>\d</code> to match digits instead of <code>*</code>. I tested it <a href="https://regex101.com/r/tN0bG9/1" rel="nofollow">here</a>.</p>

python regex