| 40 | }; |
| 41 | |
| 42 | class common_regex { |
| 43 | std::string pattern; |
| 44 | std::regex rx; |
| 45 | std::regex rx_reversed_partial; |
| 46 | |
| 47 | public: |
| 48 | explicit common_regex(const std::string & pattern); |
| 49 | |
| 50 | common_regex_match search(const std::string & input, size_t pos, bool as_match = false) const; |
| 51 | |
| 52 | const std::string & str() const { return pattern; } |
| 53 | }; |
| 54 | |
| 55 | // For testing only (pretty print of failures). |
| 56 | std::string regex_to_reversed_partial_regex(const std::string & pattern); |