updated index.php to use regular expressions