Results 1 to 4 of 4
Thread: preg_match conditions required
Jan 5, 2013, 01:34 #1
- Join Date
- Nov 2012
- 0 Post(s)
- 0 Thread(s)
preg_match conditions required
I am a bit week with regular expressions in PHP, in any language actually. I am building a registration form and I am checking for certain conditions. I have solved a few of them, but I got stuck with these.
I do not want the user to be registered if:
1) The username can be only alphanumeric but must start with an alphabet. No special characters to be allowed.
2) The first name and last name can have only alphabets and not anything else.
3) The roll number can only be a 10 digit number, not anything less, not anything more, no other characters allowed.
4) The most important of all, I want users to sign up with email id given by my college. That is, allow registrations only if specific domain exists in the email ID.
Can anyone please help me with these, and also explain the codes?