Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matches returned twice due to double foreach #9

Open
martinsohn opened this issue Sep 22, 2021 · 1 comment
Open

Matches returned twice due to double foreach #9

martinsohn opened this issue Sep 22, 2021 · 1 comment

Comments

@martinsohn
Copy link

martinsohn commented Sep 22, 2021

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;

@vivami
Copy link
Owner

vivami commented Sep 25, 2021

Thanks for reporting this issue @martinsohn, I need to further investigate when I have some more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants