It is expected that you would attempt to do what you need and share the code you have tried with the question. Having said that, here is something you can make use of:
You can choose from either regex method or non-regex method from following code.
function Validate() {
var inputString = 'DE55680501010022061234';
var regEx = /DE\d{20}$/;
if (regEx.test(inputString) == false) {
alert('Not right!')
}
if (inputString.length != 22) {
alert('Not right!')
}
if (inputString.charCodeAt(0) != 68 || inputString.charCodeAt(1) != 69) {
alert('Not right!')
}
for (var i = 2; i < 22; i++) {
if (!(inputString.charCodeAt(i) > 47 && inputString.charCodeAt(i) < 58)) {
alert('Not right!')
}
}
}