pattern_group.h 474 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <library/cpp/regex/pcre/regexp.h>
  3. #include <util/generic/map.h>
  4. #include <util/generic/vector.h>
  5. #include <util/generic/maybe.h>
  6. #include <utility>
  7. namespace NYql {
  8. class TPatternGroup {
  9. public:
  10. TPatternGroup() = default;
  11. void Add(const TString& pattern, const TString& alias);
  12. bool IsEmpty() const;
  13. TMaybe<TString> Match(const TString& s) const;
  14. private:
  15. TMap<TString, std::pair<TRegExMatch, TString>> CompiledPatterns;
  16. };
  17. }