I have never worked with RegEx and have been trying to perform validation to ensure a module code matches the correct format. A valid module code should be in the form: CSC8001
My code is as follows:
if(moduleCode.matches("^CSC8\d{3}")){
throw new IllegalArgumentException();
}
This produces an invalid escape sequence error which I have been unable to resolve.
Thanks in advance, Mark.