in reply to Re: Need help for Xpath patterns
in thread Need help for Xpath patterns

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.