Subject: | split in pattern breakdown |
Date: | Tue, 24 Jun 2008 11:20:49 -0400 |
To: | bug-Class-XPath [...] rt.cpan.org |
From: | "Arkadiy Kukarkin" <parkan [...] gmail.com> |
Class::XPath currently uses my @parts = split("/",$xpath) to break up the
XPath arguments. This is bad if your xpath search string for attribute value
includes a "/", such as when looking for mimetypes in RSS feed
enclosure/media element attributes (like "video/mp4"). An alternative
solution that works for me is:
my @parts = ( $xpath =~ m{ (?:^|\G) ( (?: [^/"] | ["][^"]*["] )+ ) (?: [/] |
\z ) }xg );
This is on v5.8.4 built for i686-linux but it's not really platform
dependent