I believe yours is very close, you just need to account for the periods in the last character set. Like so:
^app-[a-zA-Z0-9]{1,}-[a-zA-Z0-9]{1,}-[a-zA-Z0-9]{1,}-[a-zA-Z0-9.]{1,6}$