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:
string.replaceAll("^.*123S","");
Remove non-greedy ? to match last occurence and .* everything before.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With