Skip to content

Commit

Permalink
Updated other regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSiem committed Nov 11, 2023
1 parent 80437e8 commit 166c7ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions ComputerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public string getString()
// CPU Label string processing
string cpuString = processor.name;
cpuString = getShortString(cpuString, new string[] {
@"(((Platinum)|(Gold)|(Silver)|(Bronze)) \w*-*\d+\w*)|(\w+-*\d{3,}\w*( v\d)*)" // regex voor vrijwel alle core i en xeon processoren vanaf 2006
@"(Platinum|Gold|Silver|Bronze)(?: )(\w*-*\d+\w*)", // Xeon gold, silver etc.
@"(\w+-*\d{3,}\w*)(?: )*(v\d)*", // Core i and Xeon non metal
});
if (processorAmount > 1)
{
Expand Down Expand Up @@ -124,8 +125,8 @@ public string getString()
{
gpuString += getShortString(gpu.videoController.name, new string[] {
@"\w{2,3} Graphics \w+", // Intel intergrated graphics (HD Graphics 405, Pro Graphics 600)
@"Quadro (RTX )*\w+", // Quadro's (Quadro RTX 4000, Quadro K2200, Quadro M2000M)
@"GeForce \wTX \d{3,}( \w+)*" // Nvidia GeForce GTX / RTX 3060 Ti
@"(Quadro|RTX) *(\w+) ?(\d+)?", // Quadro's (Quadro RTX 4000, Quadro K2200, Quadro M2000M)
@"(GeForce) (\wTX?) (\d{3,})(?: (\w+))*" // Nvidia GeForce GTX / RTX 3060 Ti
}) + "\r\n";
}

Expand All @@ -149,6 +150,8 @@ public static string getShortString(string input, string[] regexes)
if (item.IsMatch(input))
{
var match = item.Match(input);
if (match.Groups.Count == 1)
return match.Groups[0].Value;
var s = "";
for(int j = 1; j < match.Groups.Count; j++)
{
Expand Down
7 changes: 4 additions & 3 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ private void scanSystem(object sender, RoutedEventArgs e)
// CPU Label string processing
string cpuString = system.processor.name;
cpuString = ComputerSystem.getShortString(cpuString, new string[] {
@"(((Platinum)|(Gold)|(Silver)|(Bronze)) \w*-*\d+\w*)|(\w+-*\d{3,}\w*( v\d)*)" // regex voor vrijwel alle core i en xeon processoren vanaf 2006
@"(Platinum|Gold|Silver|Bronze)(?: )(\w*-*\d+\w*)", // Xeon gold, silver etc.
@"(\w+-*\d{3,}\w*)(?: )*(v\d)*", // Core i and Xeon non metal
});
if (system.processorAmount > 1)
{
Expand Down Expand Up @@ -98,8 +99,8 @@ private void scanSystem(object sender, RoutedEventArgs e)
{
gpuString += ComputerSystem.getShortString(gpu.videoController.name, new string[] {
@"\w{2,3} Graphics \w+", // Intel intergrated graphics (HD Graphics 405, Pro Graphics 600)
@"Quadro (RTX )*\w+", // Quadro's (Quadro RTX 4000, Quadro K2200, Quadro M2000M)
@"GeForce \wTX \d{3,}( \w+)*" // Nvidia GeForce GTX / RTX 3060 Ti
@"(Quadro|RTX) *(\w+) ?(\d+)?", // Quadro's (Quadro RTX 4000, Quadro K2200, Quadro M2000M)
@"(GeForce) (\wTX?) (\d{3,})(?: (\w+))*" // Nvidia GeForce GTX / RTX 3060 Ti
}) + "\r\n";
}

Expand Down

0 comments on commit 166c7ff

Please sign in to comment.