I have the following string:
function init() {
$.get("/example/abc/include.txt", function(script) {
code goes here
});
$.get("<http>://abc.com/example/abc/dontinclude.txt", function (script) {
code goes here
}
});
}
I am trying to parse the above string to list all the URL's which starts from /example and ends with file name like abc.txt.
So the desired list should be:
/example/abc/include.txt
I tried with the following regex :
(\/)[^\s\/]?(example\/)(\w+\/)*(\w+.\w{3,4})
But it list two URLs as below:
/example/abc/include.txt
/example/abc/dontinclude.txt
I changed the above regex to :
\"(\/)[^\s\/]?(example\/)(\w+\/)*(\w+.\w{3,4})\"
This returns the required URL but I want exclude the double quotes from the result.
Any Idea how to remove the double quotes using the regex?
Thanks.