Hey guys I've 1 question. This code works: if(document.form.filed.value.match( /Your text/ig)) but if I want to add << http://www >> e.g if(document.form.filed.value.match( / http://www /ig)) it doesn't work is it because of the 'slash'?
you need to escape the slashes.. if(document.form.filed.value.match( / [url]http:\/\/www[\/url] /ig)) Code (markup): if it still doesn't work, escape the regular expression symbols that should be text.. if(document.form.filed.value.match( / [url]http:\/\/www[\/url] /ig)) Code (markup):
Hi I've one more questions, how to add 'wildcard', for example will this works if(document.form.filed.value.match( / http:\/\/*.com /ig))
yes it will, but it will also valid for invalid url forms.. http://i-@m-an-!nvALiD_d0maiN.com you may want to just use this.. if(document.form.filed.value.match( / http:\/\/[a-z0-9\-\_\.].com /ig))