Hey all,
I need to remove some characters at the end of a certain list of item. These characters are always the same (C, CD, PDF, CPDF, M) and with this regular expression I'm able to get rid of them :
str.replaceAll("(C|CD|PDF|CPDF|M)$", "");
However, I'm not able to inverse this expression : I'd like to be able to isolate (by removing the rest of the string, for exemple) any of these code, if they're at the end of the string. I tried this :
str.replaceAll("!(C|CD|PDF|CPDF|M)$", "");
I probably get by using some string functions, but I'm sure it's possible using only regular expression.