View Full Version : how to do the match in jquery?

07-26-2011, 02:55 AM
eg: there is a url as this: http://example.com

i want to make a match that the second part in the url are beginning of test. eg:

thank you.

07-26-2011, 07:04 AM
A match? What does this have to do with jQuery? I think this is pure javascript with regular expressions

var myRegex = new RegExp("http:\/\/example\.com\/test", "i");
if(yourURL.match(myRegex)) {

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum