How to validate the car registration number in android.I am giving like this every time it shows toast message.I want like this AP05TB3456.can any one solve this isssue?
String numPlate = "(([A-Za-z]){2,3}(|-)(?:[0-9]){1,2}(|-)(?:[A-Za-z]) {2}(|-)([0-9]){1,4})|(([A-Za-z]){2,3}";
if (reg_no.getText().toString().equalsIgnoreCase("")||!reg_no.getText().toString().contentEquals(numPlate))
{
Toast.makeText(MoreInfoactvity.this, "Please Enter Valid Registration Number", Toast.LENGTH_SHORT).show();
}