Skip to content

Matches returned twice due to double foreach #9

Description

@martinsohn

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

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

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

var res = -1;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions