Skip to content

Wildcard matching should be used in help file search #3967

@lzybkr

Description

@lzybkr

In #3852 - the change treats the parameter like a wildcard, but uses a regex. Also, the fix repeatedly checks (inside the loop) if it's a pattern, that can be done once.

I would have expected a fix more like:

            var wildcardPattern = WildcardPattern.ContainsWildcardCharacters(pattern)
                ? WildcardPatter.Get(pattern, WildcardOptions.IgnoreCase)
                : null;

            foreach (string filePath in files)
            {
                if (filePath.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) >= 0)
                {
                    result.Add(filePath);
                    break;
                }

                if (wildcardPattern.?IsMatch(pattern))
                {             
                    result.Add(filePath);
                }
            }

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Interactive-HelpSystemhelp infrastructure and formatting of help

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions