I'm trying to write a register page and this parse error came out: Parse error: syntax error, unexpected '[' in /usr/local/apache2/htdocs/register.php Here is part of the code: if (eregi ('^[[:alpha:]]\.\'\-{2,15}$',stripslashes(trim($POST['name'])))) { $n = escape_data($_POST['name']); } else { $n = FALSE ; echo '<p><font color="red" size="+1">Please enter a user name!</font></p>'; } I thought it is the single quotes problem so I have tried this: if (eregi ('^[[:alpha:]]{2,15}$',stripslashes(trim($POST['name'])))) { $n = escape_data($_POST['name']); } else { $n = FALSE ; echo '<p><font color="red" size="+1">Please enter a user name!</font></p>'; } but the same error popped up, can anyone tell me what the problem is?