Código completo con los FORM
<form id="form1">id="form1" enctype="multipart/form-data">
<input name="placa" type="text" id="placa" onkeyup="form1.placa.value=form1.placa.value.toUpperCase()" size="8" maxlength="7" style="font-size:25px;">
</form>
<script>
const input = document.querySelector('input');
const value = document.getElementById("placa").addEventListener("keypress",value;
var expresion1 =/[A-Za-z]/;
var expresion2 = /[A-Za-z0-9]/;
input.onkeyup = logKey;
function logKey(e) {
if (this.value.length<3 && /[A-Za-z]/value.testmatch(e.keyexpresion1)==true) {
this.value+=evalue+=value.keyvalue.toUpperCase();
}
if (this.value.length>=4 && /[A-Za-z0-9]/value.testmatch(e.keyexpresion2)==true) {
return;
}
if (this.value.length==3) {
this.value+="-";
}
e.preventDefault();
});
</script>