943,671 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 387
  • ASP.NET RSS
Aug 17th, 2009
0

Regex

Expand Post »
Can somebody help me in making me understand the regex function-

What these characters means
/^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/


ASP.NET Syntax (Toggle Plain Text)
  1. function validate(input)
  2. {
  3. var email =/^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/;
  4. if(email.test(input))
  5. {
  6. return true;
  7. }
  8. else
  9. {
  10. alert('invalid email id');
  11. return false;
  12. }
  13. }
Similar Threads
Reputation Points: 17
Solved Threads: 0
Junior Poster in Training
mansi sharma is offline Offline
75 posts
since Apr 2008
Aug 17th, 2009
0

Re: Regex

\w means a word character
+ means one or more
\- means dash
\. means .
* means zero or more

it represents a simple check to see if the email address is valid
Sponsor
Featured Poster
Reputation Points: 550
Solved Threads: 728
Bite my shiny metal ass!
pritaeas is offline Offline
4,163 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: ASP.NET Zedgraph.Web How to remove duplicate legend?
Next Thread in ASP.NET Forum Timeline: need suggestion





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC