in reply to Regex: Matching last of repeated character to end of string

What happens with your regex is it finds the first "/" it can, and then the ".*?" matches any character until the end. It sounds like you might want something more like this:
$xpathOther =~ s|/[^/]*$||;
This ensures that it matches on the last "/" it can find, and blanks it and everything after it out.

-jbWare