JavaScript Regex question
Posted
by Vincent
on Stack Overflow
See other posts from Stack Overflow
or by Vincent
Published on 2010-06-11T15:36:58Z
Indexed on
2010/06/11
15:53 UTC
Read the original article
Hit count: 170
JavaScript
All,
I have following function to check for invalid symbols entered in a text box and return true or false. How can I modify this function to also check for occurrences like http:// and https:// and ftp:// return false if encountered ?
function checkURL(textboxval) {
return ! (/[<>()#'"]|""/.test(textboxval));
}
Thanks
© Stack Overflow or respective owner