Are you sure there should not be trailing $? Without it, returning true makes a lot of sense - the first block [a-z]matches the first two characters a, [0-9]nothing matches, and the last [a-z]matches the 3rd a. The ultimate is 1ignored.
Looking at the link to the book, there seems to be an error:
Must end with a lowercase letter
, $.