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
currently the prefixregex function matches 40 chars before the occurrence of the token. It would be nice to also match after the presence of the token. I have seen instances where the keyword appeared after the token and not before.
func PrefixRegex(keywords []string) string {
pre := (?i)(?:
middle := strings.Join(keywords, "|")
post := )(?:.|[\n\r]){0,40}
return pre + middle + post
}
The text was updated successfully, but these errors were encountered:
It requires creating a new match group, which is complicated due to trufflesecurity#2746. Hopefully that can be merged now that they've added rudimentary unit tests to most detectors...
currently the prefixregex function matches 40 chars before the occurrence of the token. It would be nice to also match after the presence of the token. I have seen instances where the keyword appeared after the token and not before.
func PrefixRegex(keywords []string) string {
pre :=
(?i)(?:
middle := strings.Join(keywords, "|")
post :=
)(?:.|[\n\r]){0,40}
return pre + middle + post
}
The text was updated successfully, but these errors were encountered: