Hello everyone here...
I need to build up a swing application related to vehicle registration and in which i want to do input the vehicle number of indian standard, like
Try this
^[A-Z]{2}\s[0-9]{2}\s[A-Z]{2}\s[0-9]{4}$
^
means start of string
[A-Z]{2}
means 2 characters in the range of A through Z
\s
means white space
[0-9]{2}
means 2 characters in the range of 0 through 9
\s
means white space
[A-Z]{2}
means 2 characters in the range of A through Z
\s
means white space
[0-9]{4}
means 4 characters in the range of 0 through 9
$
means end of string
Based on what you said in your question this should be a very broad check against proper format, but I have a feeling that there are more specific regulations on how the license plates are numbered. Let me know if there are additional constraints for the regex.