This expression must adhere to specific rules:
1.- Between 2 and 8 characters total.
2.- Start with uppercase.
3.- Contain both lowercase and digits.
The first and second should be easy, but I can't get the third one to work.
This is the expression I came up with
([A-Z]+[A-Za-z0-9]*){2,8}
But it returns incorrect responses. Regular expressions are far from my forte, and this is the first time I had to use them outside of class.
This is my code, if it helps
var expresion = /([A-Z]+[A-Za-z0-9]*){2,8}/;
var re = new RegExp(expresion);
var t = $('#code').val();
if (re.test(t)) {
console.log(t+' works');
} else {
console.log(t+' not working');
}