Regex pattern within text
<p>I have a long string of data which looks like:</p>

<pre><code>dstgfsda12345.123gsrsvrvsdfcsd23456.234tsrsd
</code></pre>

<p>Notice that the '12345.123' pattern is the same. I want to split the string on it using python (so <code>s.split(&lt;regex&gt;)</code>).</p>

<p>What would be the appropriate regex?</p>

<pre><code>'[0-9]{5}.[0-9]{3}'
</code></pre>

<p>does not work; I presume it expects whitespace around it(?).</p>

<p>I don't understand exactly what's your actual need but seems that you want your regex to isolate each occurrence of 5 digits, dot, 3 digits.</p>

<p>So instead of <code>'[0-9]{5}.[0-9]{3}'</code> you must use <code>'[0-9]{5}\.[0-9]{3}'</code>, because <code>.</code> matches any character, while <code>\.</code> matches only a dot.</p>

python regex