 <p>You can use</p> <pre><code>^(?!0$)\d+(?:[,.][05])?$ </code></pre> <p>See <a href="https://regex101.com/r/iJ6dY5/7" rel="nofollow">demo</a></p> <p>This will match your required numbers and will exclude a <code>0</code>-only number thanks to the look-ahead at the beginning.</p> <p>Main changes:</p> <ul> <li><code>\d+</code> - replaced <code>[1-9]\d*</code> to allow a <code>0</code> as the integer part</li> <li><code>[,.]</code> - replace <code>\.</code> to allow a comma as a decimal separator.</li> <li>The lookahead adds a <code>0</code>-number exception.</li> </ul> <p>The lookahead can be enhanced to disallow <code>0.000</code>-like input:</p> <pre><code>^(?!0+(?:[,.]0+)?$)\d+(?:[,.][05])?$ </code></pre> <p>See <a href="https://regex101.com/r/iJ6dY5/6" rel="nofollow">another demo</a>.</p>