Skip to content

Feature request, support PCRE-style features, including lookaheads and backreferences in nsq_to_file to allow for wildcard archiving with exclusions #1517

Description

@danbf

Right now nsq_to_file only supports RE2 style regex's in

match, err := regexp.MatchString(t.opts.TopicPattern, topic)
through the use of the built-in golang regexp.MatchString. This prevents the use of wildcard archiving with exclusions which is a use case we have.

So a topic pattern like .* works but one like ^(?!not_so_important_events$)[a-z0-9_]+$ which would ignore the topic not_so_important_events doesn't work since it requires lookaheads which RE2 does not permit.
like: https://regex101.com/r/4S2pGx/1

Would you be up to accept a PR that added the https://github.com/philipprochazka/regexp2 library and used it for this regex in

match, err := regexp.MatchString(t.opts.TopicPattern, topic)

@mreiferson thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions