Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 06-26-2007, 10:45 PM string filtering
Junior Talker

Posts: 3
Location: Newfoundland, Canada
Trades: 0
I was looking for some email validation scripts and came across this:

-------------------------------
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e);
return returnval;
}
-------------------------------

It works but I've never seen anything like that first line before. What is it called so I can learn more about it?
epochonaut is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-27-2007, 08:40 AM Re: string filtering
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
It is a regular expression.

here is some more info:
http://www.webreference.com/js/column5/
http://www.regular-expressions.info/javascript.html
http://en.wikipedia.org/wiki/Regular_expression

Have fun :-)
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to string filtering
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09518 seconds with 12 queries