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?
Right now
nsq_to_fileonly supports RE2 style regex's innsq/apps/nsq_to_file/topic_discoverer.go
Line 99 in 51470ca
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 topicnot_so_important_eventsdoesn'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
nsq/apps/nsq_to_file/topic_discoverer.go
Line 99 in 51470ca
@mreiferson thoughts?