You have an error in you Regex:
Remove those double square brackets in the last part of your Regex ;)
This should work:
^[0-9]{4}-[0-9]{1}-[0-9a-zA-Z]*$"
Hint: To test your Regex this is a handy site:
http://regexpal.com/[
^]
Btw. I don't really know what you mean by
Shubh Agrahari wrote:
then anything else means its would alpha ar numeric but over limit of 15digit
Do you want to limit the whole string to max 15 chars. or the last part can be 0-15 chars? or has the last part to be longer longer than 15 chars?