i found this function that validates the length of twitter account.
Your username can contain up to 15 characters.
function validate_username($username)
{
return preg_match('/^[A-Za-z0-9_]{1,15}$/', $username);
}
How can I change this rule to make @ symbol optional in the beginning of the string !
Samples of valid inputs
abcdabcdabcdabc
@abcdabcdabcdabc
The
?can be used to to make the previous character optional:Equivalently: