Skip to content

Improvement: PrefixRegex Function #25

@ankushgoel27

Description

@ankushgoel27

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
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions