Google API Key Regular Expression

A regular expression to match a Google API Key (Google Maps, Youtube Data, Google Calendar, Google Drive, etc…).

/AIza[0-9A-Za-z\\-_]{35}/

Matches:

  • AIzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  • AIzaAaBaCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Non-matches:

  • AIzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  • aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa