...

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



runeveryday
07-26-2011, 03: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:
http://example.com/test/...


thank you.

devnull69
07-26-2011, 08: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