package executor import ( "fmt" "regexp" "strings" schemepkg "git.buran.team/main/cep/scheme" ) type NotMatchProcessor struct { expression *regexp.Regexp } func NewNotMatchProcessor(processorScheme schemepkg.Processor) (*NotMatchProcessor, error) { e, err := regexp.Compile(processorScheme.KindNotMatch.Expression) if err != nil { return nil, fmt.Errorf("can't create not-match processor: %w", err) } return &NotMatchProcessor{ expression: e, }, nil } func (this *NotMatchProcessor) Process(buffer []byte) bool { lines := strings.Split(string(buffer), "\n") for _, line := range lines { if this.expression.Match([]byte(line)) { return false } } return true }