I want to validate this NIC number in Android Java.
NICs=NIC.getText().toString();
if((nameS.equals("")||NICs.equals(""))||!(NICs.matches("/^[0-9]{9}[vVxX]$/")))
{
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
this);
// set title
alertDialogBuilder.setTitle("Warning!");
// set dialog message
alertDialogBuilder
.setMessage("Please fill the above feilds !")
.setCancelable(false)
.setNegativeButton("OK",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int id) {
// if this button is clicked, just close
// the dialog box and do nothing
dialog.cancel();
}
});
My NIC="896201328V" But it says NIC mismatches with the pattern given.