My two cents....
<?
/
if spaces aren't allowed either,
then remove the [:space:]
part of the regex
*/
function checkFormat($var)
{
if(eregi("[/'a-zA-Z[:space:]/-]", $var))
return false;
return true;
}
$text1="Tom's Car - Late Model Buick";
$text2="Fred's Car - '66 Cadillac";
checkFormat($text1)?print"Good":print"Bad";
print"<br>";
checkFormat($text2)?print"Good":print"Bad";
?>