The regex /\d[A-Z]/
says that the input must have a digit first, and then an alphabet must be present.
Since the input CD
doesnot contain a digit and an alphabet following it, the function returns 0.
To match more than one capital letters or digits, you can use the following regex.
/[\dA-Z]+/