The only possible value this field can have is P
followed by a 0,1,2,3,4
and 0,1,2,3,4
$option_print = $this->input->post('print');
if (!preg_match('^/p[0-4][0-4]/', $option_print))
{ redirect('#example'); } else { ... }
Example of VALID inputs:
-
p00
-> valid -
p10
-> valid
Example of INVALID inputs:
-
v00
-> invalid -
f10
-> invalid -
ffs
-> invalid
So how should my regex
be properly structured to filter for VALID inputs?