javascript - With regex how do i match between an XML tag multiple times? -
first, before anything, have because rss malformed, can't correct on end. so, while tried using rss , xml parser, fail , have front end access. however, i'm super close, can't figure out why wont match.
the feed (it's long 1 line string): http://pastebin.com/5djhxcvf
first example:
<title>(.+)</title>
this thought worked great test of just:
<title>"cterrorism task force" location:oregon - google news</title>
but issue matches 1 match example:
<title>"cterrorism task force" location:oregon - google news</title><title>"cterrorism task force" location:oregon - google news</title>
equals 1 result item in array exec()
, match()
so tried:
<title>([\w\d\s\=\%\_\`\~\+\!\@\#\$\%\^\&\*\(\)\:\'\"\[\]\{\}\|\,\.\/]+)</title>
but returns nothing... ideas?
try non-greedy version <title>(.+?)<\/title>
. here can test these things online.
Comments
Post a Comment