Regex find ALL patterns betwen string
<p>I want to match digits betwen "000" or betwen \b and "000" or "000" and \b from a string like this: </p>

<pre><code>11101110001011101000000011101010111
</code></pre>

<p>I have tried with expressions like this:</p>

<pre><code>(?&lt;=000)\d+(?=000)
</code></pre>

<p>but I only get the largest occurrence </p>

<p>I expect to get:</p>

<pre><code>1110111
1011101
0
11101010111
</code></pre>

<p>you can do it with the re module like this:</p>

<pre><code>re.findall(r'(?:\b|(?&lt;=000))(\d+?)(?:000|\b)', s)
</code></pre>

python regex string digits