4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 What does this mean?
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
metsfan922
Junior WebHelper
Junior WebHelper


Joined: 09 May 2002
Posts: 15

PostPosted: Sat May 18, 2002 4:39 am (21 years, 11 months ago) Reply with QuoteBack to Top

"/^([a-zA-Z0-9\-_\.]+)\@[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/";

someone posted this claiming it could be used for validation. can you please explain to me wat all the slashes and stuff mean?
OfflineView User's ProfileFind all posts by metsfan922Send Personal Message
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Sat May 18, 2002 5:35 am (21 years, 11 months ago) Reply with QuoteBack to Top

It is basically a regular expression. The one you have given will validate emails, that is whether the given email is in correct format or not.

Learning to Use Regular Expressions by Example is an excellent article. There are whole chapters dedicated to this in books of Perl(mostly).

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Sat May 18, 2002 5:45 am (21 years, 11 months ago) Reply with QuoteBack to Top

By the way. the given regular expression will not validate the new domains having 4 letters at end, like in .info

/^([a-zA-Z0-9\-_\.]+)\@[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/
will validate the new ones also

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
metsfan922
Junior WebHelper
Junior WebHelper


Joined: 09 May 2002
Posts: 15

PostPosted: Sat May 18, 2002 3:36 pm (21 years, 11 months ago) Reply with QuoteBack to Top

/^([a-zA-Z0-9\-_\.]+)\@[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/

please explain each section individually
OfflineView User's ProfileFind all posts by metsfan922Send Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sat May 18, 2002 3:38 pm (21 years, 11 months ago) Reply with QuoteBack to Top

Did you read the article mentioned above?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 3.515294 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme