func NewREMatcher(pattern string) (*REMatcher, error) {
	re, err := regexp.Compile(pattern)
	if err != nil {
		return nil, err
	}
	return &REMatcher{
		pattern: re,
	}, nil
}
NewREMatcher returns a new REMatcher that performs a check against the
provided pattern.
package matchers
import (
	"os"
	"regexp"
	"strings"
	"time"
	"github.com/kbrgl/fuzzy"
)
type FileMatcher interface {
	Match(os.FileInfo) bool
}
type FuzzyMatcher struct {
	pattern string
}
func NewFuzzyMatcher(pattern string) *FuzzyMatcher {
	return &FuzzyMatcher{pattern: pattern}
}
func (f FuzzyMatcher) Match(fi os.FileInfo) bool {
	return fuzzy.MatchFold(fi.Name(), f.pattern)
}
type ExactMatcher struct {
	expected string
}
func NewExactMatcher(expected string) *ExactMatcher {
	return &ExactMatcher{
		expected: expected,
	}
}
func (e ExactMatcher) Match(fi os.FileInfo) bool {
	return fi.Name() == e.expected
}
type SuffixMatcher struct {
	suffix string
}
func NewSuffixMatcher(suffix string) *SuffixMatcher {
	return &SuffixMatcher{
		suffix: suffix,
	}
}
func (s SuffixMatcher) Match(fi os.FileInfo) bool {
	return strings.HasSuffix(fi.Name(), s.suffix)
}
type PrefixMatcher struct {
	prefix string
}
func NewPrefixMatcher(prefix string) *PrefixMatcher {
	return &PrefixMatcher{
		prefix: prefix,
	}
}
func (p PrefixMatcher) Match(fi os.FileInfo) bool {
	return strings.HasPrefix(fi.Name(), p.prefix)
}
type REMatcher struct {
	pattern *regexp.Regexp
}