Page 1 of 1

php regex preg_match validation

Posted: Thu Aug 19, 2010 2:56 pm
by bradleybebad
Does this sort of regex within php preg_match look like a working validation?

if (preg_match("/^[a-zÇÑQÀÁÈÉÍÌÏÓÒÚÙÜ]|[\t]+$/i]",$_POST["i1"])) {
$_SESSION['i1'] = $_POST["i1"];
}

Re: php regex preg_match validation

Posted: Fri Aug 20, 2010 7:02 am
by Mordred
A working validation for what? It does check (quite clumsily) if a string contains only a certain set of characters. Whether this is what you want, only you can tell :)