I think I need regex, but my regex noobtown.
given this string:
/MyUrl?query=http://www.domain.com/category/index.jsp%3FcategoryId&bonkers=Upp&this=that
how can I simply just get the domain out of this: So remove the preceeding
/MyURL?query=
and then everything from and including &bonkers and onward. Basically just need the straight url with no parameters so the result looks like
http://www.domain.com/category/index.jsp%3FcategoryId%3D4414047
Knowing absolutely nothing about regex I got this far
.*url\?q=(.*)&sa
but that doesn't quite do it. I'm attempting to parse a string in jquery to just return each URL in a matched select
$(data).find(".link a").each(function(){
console.log($(this).attr('href'));
//returns string with garbage before and after
});