Function match

Synopsis

#include <include/internal/catch_matchers_string.h>

bool match(std::string const &matchee) const override

Description

No description yet.

Source

Lines 84-91 in include/internal/catch_matchers_string.cpp. Line 57 in include/internal/catch_matchers_string.h.

bool RegexMatcher::match(std::string const& matchee) const {
    auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway
    if (m_caseSensitivity == CaseSensitive::Choice::No) {
        flags |= std::regex::icase;
    }
    auto reg = std::regex(m_regex, flags);
    return std::regex_match(matchee, reg);
}





Add Discussion as Guest

Log in