Regex Lookaheads

Posted by Michael on Stack Overflow See other posts from Stack Overflow or by Michael
Published on 2010-04-30T05:22:32Z Indexed on 2010/04/30 5:27 UTC
Read the original article Hit count: 262

Filed under:
|

Need to capture content of root <pubDate> element, but in document it can be either within <item> element or within <channel> element. Also <item> is child of <channel> I'll bring example

<channel>
  ...
  <pubDate>10/2/2010</pubDate>
  ...
  <item>
    ...
    <pubDate>13/2/2029</pubDate>
    ...
  </item>
  ...
</channel>

need to capture 10/2/2010

With the <item> no problem, can capture it, along with its <pubDate>.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex