What is the regex for checking format of a string : What is the regex for finding if user input is properly formatted?

Format should follow:
`AAAA-123` or `AAAA123` 

Where the first 4 characters are letters in the range A-M and the following  3 characters are numbers with a max of 299