3
I need to write a javascript regex that contains a specific piece of URL, but I’m not able to, mainly because it’s a url with "/".
Example: Any "like" or partial match to "www.url.com/foo"
www.url.com/foo/bar/send/123 - true
www.url.com/foo/doe/get/123 - true
www.url.co/foo/doe/get/123 - false
http://www.url.com/foo/get/123 - true
http://www.url.co/foo/doe/123 - false
Any idea how to make a "generic" regex for any other urls as well?
The
url.com
it’s fixed whatever comes next can be anything?– rray
Have you tried declaring the regular expression Regexp? var re1 = new Regexp("abc");
– Marcell Alves