I'd like to have a regexp in java to only strip off numbers if they are at the end of the string and everything after the underscore.
1) massi_xxx -> massi
2) massi_12121 -> massi
3) massi123 -> massi
4) 123massi1 -> 123massi
I found that
(?=[0-9_]).*
works fine for 1,2,3 use case but not for 4)
Any idea on how to refine it?
Thanks M.