Skip to content

Commit

Permalink
Improve reg regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
gus33000 committed Apr 2, 2024
1 parent 1f6a560 commit c97c40e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DriverUpdater/RegistryFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static void FixLeftOvers(string DrivePath)
private static void FixDriverStorePathsInRegistryValueForLeftOvers(RegistryKey registryKey, string registryValue)
{
Regex regex = new("(.*oem[0-9]+\\.inf.*)|(.*(QCOM|MSHW|VEN_QCOM&DEV_|VEN_MSHW&DEV_)[0-9A-F]{4}.*)|(.*surface.*duo.*inf)|(.*\\\\qc.*)|(.*\\\\surface.*)");
Regex antiRegex = new("(.*QCOM((2465)|(2466)|(2484)|(2488)|(24A5)|(24B6)|(24B7)|(24BF)|(7002)|(FFE1)|(FFE2)|(FFE3)|(FFE4)|(FFE5)).*)|(.*qcap.*)|(.*qcursext.*)");
Regex antiRegex = new("(.*QCOM((24[0-9][0-9])|(7002)|(FFE[0-9])).*)|(.*qcap.*)|(.*qcursext.*)|(.*hidspi.*)|(.*ufsstor.*)|(.*sdstor.*)|(.*qc.*_i\\.inf.*)");

// TODO:
// Key: Microsoft\Windows\CurrentVersion\Setup\PnpResources\Registry\HKLM\ ... \
Expand Down Expand Up @@ -117,7 +117,7 @@ private static void CrawlInRegistryKeyForLeftOvers(RegistryKey registryKey)
if (registryKey != null)
{
Regex regex = new("(.*oem[0-9]+\\.inf.*)|(.*(QCOM|MSHW|VEN_QCOM&DEV_|VEN_MSHW&DEV_)[0-9A-F]{4}.*)|(.*surface.*duo.*inf)|(.*\\\\qc.*)|(.*\\\\surface.*)");
Regex antiRegex = new("(.*QCOM((2465)|(2466)|(2484)|(2488)|(24A5)|(24B6)|(24B7)|(24BF)|(7002)|(FFE1)|(FFE2)|(FFE3)|(FFE4)|(FFE5)).*)|(.*qcap.*)|(.*qcursext.*)");
Regex antiRegex = new("(.*QCOM((24[0-9][0-9])|(7002)|(FFE[0-9])).*)|(.*qcap.*)|(.*qcursext.*)|(.*hidspi.*)|(.*ufsstor.*)|(.*sdstor.*)|(.*qc.*_i\\.inf.*)");

foreach (string subRegistryValue in registryKey.GetValueNames())
{
Expand Down

0 comments on commit c97c40e

Please sign in to comment.