Can someone help me check my validation rules since it shows the error illegal escape character..thanks..
if(staffICNo.length() == 0 || !staffICNo.matches("([0-9][0-9])((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\-([0-9][0-9])\-([0-9][0-9][0-9][0-9])")){
JOptionPane.showMessageDialog(null,"IC Number must be in this format : 101010-10-1010..","",JOptionPane.WARNING_MESSAGE);
}
This is some escape character problem. In java you need to escape the ‘\’ charater inside a string.
Try