in reply to Re: XML::Twig and handles on regex/xpath
in thread XML::Twig and handles on regex/xpath

That looks fine, but from what I understand it matches everything within target, doesn't it?

But what if I want to match tag1, tag2 and tag3 but not tag4?
I guess I should have made a better example.
  • Comment on Re^2: XML::Twig and handles on regex/xpath

Replies are listed 'Best First'.
Re^3: XML::Twig and handles on regex/xpath
by wind (Priest) on Apr 28, 2011 at 08:20 UTC

    Then add the following filter within the sub

    return if $_->tag !~ /^tag[123]$/;
      So I can't really handle it within the xpath expression?!

      But your solutions works totally fine, so I guess I will do it this way.
      I thought it might make a performance difference to call the function, but I can be totally wrong with this thought :-).

      Thank you!