You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Example:
Take a rule like AI015600 (Data: Audio File). The raw pattern is mp2|mp3|mp4... with a type of regex-word. This translates to the regex \bmp2|mp3|mp4...\b, which isn't right -- e.g. foomp3bar matches this, since the \b's are attached to the first and last strings.
It looks like we have a bunch of this -- it might be a regression in the dev branch, but we might want to update:
I created a separate PR to one off fix this for 1.2, but this was already fixed in 1.3. I like your solution better than mine (splitting up the bars into separate regexes) so I've adopted that in #369 for 1.3.
Describe the bug
Example:
Take a rule like AI015600 (Data: Audio File). The raw pattern is
mp2|mp3|mp4...
with a type ofregex-word
. This translates to the regex\bmp2|mp3|mp4...\b
, which isn't right -- e.g.foomp3bar
matches this, since the\b
's are attached to the first and last strings.It looks like we have a bunch of this -- it might be a regression in the dev branch, but we might want to update:
https://github.com/microsoft/ApplicationInspector/blob/development/RulesEngine/Ruleset.cs#L401
from:
pattern.Pattern = string.Format(CultureInfo.InvariantCulture, @"\b{0}\b", pattern.Pattern);
to
pattern.Pattern = string.Format(CultureInfo.InvariantCulture, @"\b({0})\b", pattern.Pattern);
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Regex-word should only match complete words (e.g.
\b(THING)\b
).Screenshots
n/a
Additional context
ApplicationInspector.CLI 1.3.11-beta+69410edbd6
The text was updated successfully, but these errors were encountered: