I am using the following code to validate date entered in edittextbox.however in xml file I had given its input type date.
int i = validate(registerdate);
>
Java will treat \ inside a string as starting an escape sequence. Make sure you use \ instead (so that you get an actual \ character in the string) and you should be ok.
Quick Update:
As Etienne points out, if you actually want a \ in the RegEx itself, you'll need to use \\, since that will produce \ in the string, which will produce \ in the RegEx.
Your regex after correction:
String regEx ="^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\\d{2}$";