in reply to Need help for Xpath patterns

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^2: Need help for Xpath patterns
by roboticus (Chancellor) on May 25, 2012 at 11:03 UTC

    jack123:

    Ouch--Three demerits!

    1. Using a regex to parse XML (especially when the OP is clearly asking about Xpath)
    2. Incorrect regex that won't solve the problem (try $str='<c>foo</c>')
    3. Untested code without a warning. (Try adding g modifier to match to prevent an infinite loop.)

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^2: Need help for Xpath patterns
by marto (Cardinal) on May 25, 2012 at 11:04 UTC

    "Update: Whoever have voted it in minus please provide your comments for the same or it will be regarded that you don't know RE and just spending your votes for no reason."

    Run the code you provided, I'm sure its results earned a down vote or two. Also the first rule of down vote club is do not talk about down vote club.

Re^2: Need help for Xpath patterns
by marto (Cardinal) on May 25, 2012 at 10:58 UTC

    Did you run this code?

    A reply falls below the community's threshold of quality. You may see it by logging in.