Skip to content

Instantly share code, notes, and snippets.

@KarbonDallas
Created February 27, 2012 23:55
Show Gist options
  • Save KarbonDallas/1927990 to your computer and use it in GitHub Desktop.
Save KarbonDallas/1927990 to your computer and use it in GitHub Desktop.
XML PARSER~!!1
var getValue = function(dat,v){
var
reg = new RegExp(['<',v,'>(.*)<\/',v,'>'].join('')) // <tag>grabber</tag>
, res = dat.match(reg)
;
return res.length>1 ? res[1]||null : undefined
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment