Created
February 27, 2012 23:55
-
-
Save KarbonDallas/1927990 to your computer and use it in GitHub Desktop.
XML PARSER~!!1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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