Hi to all, I have found some script and I don't know the meaning especially with the especiall chatacter, I highlighted with color blue. This is my second week for learning web desing using php. I already look at the javascript but I didn't found it. Actually I found this code insside filename.js so my understanding is about with javascript. Please take a look at the code and give me an idea.
// validators ------------------------------------------------------------------
function isEmpty (s) {
var p = /\S+/;
return !p.test(s);
}
function isEmail(string) {
if (string.search[color=#0000BF](/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1[/color])
return true;
else
return false;
}
function isAlphaNum(string) {
if (string.search(/^[A-Za-z0-9]+$/) != -1)
return true;
else
return false;
}
function isNum(string) {
if (string.search(/^[0-9]+$/) != -1)
return false;
else
return true;
}
function isExecutable (s) {
var p = [color=#0000BF]/\.(bat|com|dll|exe|vbs)$/i;[/color]
return p.test(s);
}
function isImage (s) {
var p = /\.(gif|jpg)$/i;
return p.test(s);
}
function isUrl (s) {
var p = /^(http|https|ftp):\/\/\S+\.[^\.\s]{2,4}(\/\S*)?$/i;
return p.test(s);
}
Thank you very much for all your replied, But I want to know the meaning of each character so that later I could used this if needed. Where tutorial I can find this code.