File tree 1 file changed +3
-3
lines changed
Elements/AutoUnattend/ProductKey
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ Namespace Elements
28
28
Public Shared Function ValidateProductKey( key As String ) As ProductKey
29
29
DynaLog.LogMessage( "Validating product key " & Quote & key & Quote & "..." )
30
30
Dim pKey As New ProductKey()
31
- If Regex.Match ( key , "^([2346789BCDFGHJKMPQRTVWXY ]{5}-){4}[2346789BCDFGHJKMPQRTVWXY ]{5}$" ).Value <> "" Then
32
- DynaLog.LogMessage( "Regex match completed and returned values . Key is valid in syntax." )
31
+ If Regex.IsMatch ( key , "^([A-Z0-9 ]{5}-){4}[A-Z0-9 ]{5}$" ) Then
32
+ DynaLog.LogMessage( "Regex has matches . Key is valid in syntax." )
33
33
pKey.Valid = True
34
34
pKey.Key = key
35
35
Else
36
- DynaLog.LogMessage( "Regex match completed but didn't return any values . Key is invalid in syntax." )
36
+ DynaLog.LogMessage( "Regex does not have matches . Key is invalid in syntax." )
37
37
pKey.Valid = False
38
38
pKey.Key = ""
39
39
End If
You can’t perform that action at this time.
0 commit comments