I'm making an application, where I'll have to validate a google maps API key. The problem is that I do not know what patterns it follows:
AIzaSyA-OlPHUh2W7LUZXVjQjjxQ8fdCWdAASmc
Here you can see that they are uppercase and lowercase, numbers, and dashes. But will it always be like this?
Does anyone know the pattern of these keys, and how to do this with JS and PHP?
JS:
var inputstr="A3aa622-_";
var regex=/^[A-Za-z0-9-_]{30,50}$/g;
if (regex.test(inputstr)){
alert("sim");
}else{
alert("Nao");
}