i am validating email on server side
i have code of javascript whch validates
but i want pure java to validate
i ask from my faculty
she says you can do this by patterns but i don't know where to start
Don't aim for success if you want it; just do what you love and believe in, and it will come naturally.
Vikas Nahar
Greenhorn
Joined: Mar 01, 2010
Posts: 4
posted
0
What kind of validation are aiming at? Just the syntax validation?
Syntax validation can be done using parsers.
For a more detailed validation we are having a discussion on the following thread maybe it might help you.
karamjeet singh wrote:i am validating email on server side
i have code of javascript whch validates
but i want pure java to validate
i ask from my faculty
she says you can do this by patterns
but i don't know where to start
You're going to have to exert a little more effort if you want help. Post some code and ideas. Give us an idea of your skill level (Beginner, Intermediate, etc...). This isn't a code factory
But that's just a basic question about Java programming, isn't it? You can't put a method inside another method regardless of whether it's validating an e-mail address or anything else.
David Newton wrote:FWIW, the "real" regex for validating an email address is about a page long. It's actually somewhat entertaining.
What is less entertaining is when somebody decides they have to validate e-mail addresses, so they implement a regex which determines your actual e-mail address is not valid.
David Newton wrote:FWIW, the "real" regex for validating an email address is about a page long. It's actually somewhat entertaining.
I don't think it's even technically possible to write a regular expression that fully complies with the formal specification of a valid e-mail address. Syntax validation of an e-mail address doesn't really buy you a whole lot anyway. If you want to know that a user supplied e-mail address is valid and in use, just send a verification e-mail to the address containg a deeplink with an activation UID. It's a little more hassle for the user, but a far more useful means of validation.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.