Fixed detecting duplicate games with regex for issue #98

This commit is contained in:
Michael J. Seiferling
2018-02-13 20:22:03 -06:00
parent b3d9510edd
commit 1ab0e77918
3 changed files with 29 additions and 26 deletions
+18 -1
View File
@@ -258,6 +258,24 @@ Public Class mgrCommon
Return dFileSize
End Function
Public Shared Function IsMatch(ByRef oGame As clsGame, ByRef sProcessCheck As String) As Boolean
If oGame.IsRegEx Then
Try
If Regex.IsMatch(sProcessCheck, oGame.ProcessName) Then
Return True
End If
Catch
'Ignore malformed regular expressions that may have passed validation
End Try
Else
If oGame.ProcessName = sProcessCheck Then
Return True
End If
End If
Return False
End Function
Public Shared Function WildcardToRegex(ByVal sPattern As String) As String
Dim sRegEx As String
sRegEx = sPattern.Replace("*", ".*")
@@ -488,7 +506,6 @@ Public Class mgrCommon
Return sString
End Function
'Handles single parameter stings
Public Shared Function FormatString(ByVal sString As String, ByVal sParam As String) As String
sString = sString.Replace("[BR]", vbCrLf)