Here one keyword ("superunique") is given, and the single instance of the keyword is returned:

Here two keywords ("superunique" and "stringtwo") are given, and the single instance of the first keyword is returned twice:

The problem lies in that there's a foreach for keywords:
|
foreach (string keyword in Keywords) { |
Which later for each keyword also runs a foreach for regexes:
|
foreach (Regex regex in Regexes) { |
Additionally, here setting 'res' is unnecessary as it is already set in RegexSearcher.GetIndexOfRegexPattern
Here one keyword ("superunique") is given, and the single instance of the keyword is returned:

Here two keywords ("superunique" and "stringtwo") are given, and the single instance of the first keyword is returned twice:

The problem lies in that there's a foreach for keywords:
SauronEye/src/SauronEye/Searcher.cs
Line 269 in 0019969
Which later for each keyword also runs a foreach for regexes:
SauronEye/src/SauronEye/RegexSearch.cs
Line 39 in 0019969
Additionally, here setting 'res' is unnecessary as it is already set in RegexSearcher.GetIndexOfRegexPattern
SauronEye/src/SauronEye/Searcher.cs
Line 287 in 0019969