in reply to Regex: Matching last of repeated character to end of string
That's "any character that isn't a slash"use warnings; use strict; my $xpath = 'BoringNode[1]/InterestingNode[@InterestingAttribute="outg +rabe"]/AnotherBoringNode[5]'; $xpath =~ s|\/[^/]+$||; print $xpath . "\n";
|
|---|