Reputation: 2882
String someXpath = "/a/b/c[3]/preceding-sibling::c[3]/a[2]";
someXpath.replaceAll("/preceding\\-sibling::(.*)\\//", ""));
basically I am trying to get "/a/b/c[3]/a[2]";
Upvotes: 0
Views: 52
Reputation: 102086
This will remove everything up to the next /
.
someXpath.replaceAll("/preceding-sibling::[^/]*","")
Upvotes: 1