Regex

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 75
Reputation: mansi sharma is an unknown quantity at this point 
Solved Threads: 0
mansi sharma mansi sharma is offline Offline
Junior Poster in Training

Regex

 
0
  #1
Aug 17th, 2009
Can somebody help me in making me understand the regex function-

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


  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. }
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 883
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 142
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Regex

 
0
  #2
Aug 17th, 2009
\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
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 243 | Replies: 1
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC