Regex for filtering input in post field
<p>The only possible value this field can have is <code>P</code> followed by a <code>0,1,2,3,4</code> and <code>0,1,2,3,4</code></p>

<pre><code>$option_print = $this-&gt;input-&gt;post('print');

if (!preg_match('^/p[0-4][0-4]/', $option_print)) 
{ redirect('#example'); } else { ... }
</code></pre>

<p>Example of VALID inputs: </p>

<ul>
<li><code>p00</code> -> valid</li>
<li><code>p10</code> -> valid</li>
</ul>

<p>Example of INVALID inputs: </p>

<ul>
<li><code>v00</code> -> invalid</li>
<li><code>f10</code> -> invalid</li>
<li><code>ffs</code> -> invalid</li>
</ul>

<p>So how should my <code>regex</code> be properly structured to filter for VALID inputs?</p>
