I need the regex expression to remove any text before a match and including the match
eg. I want to remove “123S” and everything before it, I know I can do this with
string.replaceAll("^.*?(?=[123S])","");
string.replaceAll("123S","");
But really want to do it in a single expression (can’t find another example anywhere!)
You can do it with:
Remove non-greedy
?to match last occurence and.*everything before.