Hello all,
I wanted to remove the final section of an XPath string using a regex. I obviously don't understand non-greediness, because I though this would work:
my $xpath = 'BoringNode[1]/InterestingNode[@InterestingAttribute="outg +rabe"]/AnotherBoringNode[5]'; $xpath =~ s|\/(.*?)$||; print $xpath . "\n";
I had hoped to get
BoringNode[1]/InterestingNode[@InterestingAttribute="outgrabe"]
Can anyone help?
Thanks,
In reply to Regex: Matching last of repeated character to end of string by loris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |