No, it will match mixtures
Which isn't what you want either.
The problem is that **AND or *A*N* or AND** will all match both of the regexes you have there, whereas from your description you only want the last one.
Also, put the parens around the {} counts or you'll only get the first character in the match for that group.
>>> import re
>>> parrot = re.compile('^([A-z*]{5})([A-z*]){2}[0-9]{3}([A-z0-9]){2}$')
>>> parrot.match("AN*D*az898zz").groups()
('AN*D*', 'z', 'z')
>>> parrot = re.compile('^([A-z]{5}|[A-z]{4}\*|[A-z]{3}\*\*|[A-z]{2}\*\*\*)([A-z*]{2})[0-9]{3}([A-z0-9]{2})$')
>>> parrot.match("AN*D*az898zz").groups()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'groups'
>>> parrot.match("AND**az898zz").groups()
('AND**', 'az', 'zz')
Note I only "fixed" the first match group. The second is left as an exercise to the reader.
Also note that I didn't allow for a single letter with 4 asterisks, or 5 asterisks, under the (possibly erroneous) assumption that you won't be getting people with last names of a single or no letters. Adjust as necessary.
Also also note there may be a better way to do this.
Enjoi.