|go ahead... be a heretic|
RegEx Against Arbitrary XML Tagsby onegative (Scribe)
|on Oct 19, 2011 at 19:52 UTC||Need Help??|
onegative has asked for the
wisdom of the Perl Monks concerning the following question:
Good Day Honorable Monks,
I am attempting to use RegEx to match specific XML tags and can't seem to figure out why I can't get the results that I expect.
Here is an example xml doc:
So I have basically 5 different distinct XML tag formats to match against.
But when trying to match against <openingTagName> only using something like the following it doesn't match what I would think it would namely <openingTagName> only like from the xml tags <APPLICATION> and <ACL>. But it doesn't. Can someone give me a hint or two on how to grab only <APPLICATION> and <ACL> which once realized should help me get through the others myself.
I would have thought the negate classes would have eliminated any and all values after the initial > but it doesn't. I have spent quite a while on different patterns but none work. Any and all suggestions will be greatly appreciated.