I would not recommend building a regex in for key validation since we
may very well change the keys we hand out in the future. A better
thing would be to link to this:
http://admin.mailchimp.com/account/api-key-popup
In a convenient place in your app and then use a lightweight method,
like ping() or getAccountDetails() to verify that the key works. You
can test the responses you'll get by sending either a completely bogus
key or expiring one of your test keys and passing it through.
If you really want to build a regex in to pre-validate the key, this
seems to work for now:
/^[0-9a-z]{32}(-us[12]{1})?$/
Obviously even if the pattern is correct you'll still need to verify
that it's valid and is not an expired key, so you should probably end
up building something like I mentioned initially anyway.
jesse