JSFiddle - React, Tailwind, and code Playground

JavaScript

var errString;
        var l = "JLF5J-383Z3-QQKWR-JEN3T-39NUT-3";
        var m = "12345-67890-12345-67890-A";
        
        function Check_License_Key_Format(license) {
            var regexLicense = new RegExp("^([A-za-z0-9]{5}[-]){5}[A-Za-z0-9]$");
            return regexLicense.test(license);
        }
        
        if (Check_License_Key_Format(l) == false)
            errString = "problem";
        else
            errString = "no problem";            
        alert(errString);
        
	      if (Check_License_Key_Format(m) == false)
            errString = "problem";
        else
            errString = "no problem";
        alert(errString);