Please help with java regex.
How to find last group between / from the back?
Example:
sdfsdf/inb/SDF/sdf1/int
answer: sdf1
>Solution :
We could use String#replaceAll for a one-liner solution:
String input = "sdfsdf/inb/SDF/sdf1/int";
String output = input.replaceAll(".*/([^/]+)/[^/]+$", "$1");
System.out.println(output); // sdf1