Header lexy/action/match.hpp

Action lexy::match

namespace lexy
    template <production Production>
    constexpr bool match(const input auto& input);

    template <production Production, typename ParseState>
    constexpr bool match(const input auto& input, const ParseState& state);

An action that determines whether Production matches on input.

It parses Production on input. All values produced during parsing are discarded; all errors ignored. Returns true if parsing was successful without errors, returns false if parsing lead to an error, even if it recovered.

Use lexy::validate to get information about the parse error.
Production does not need to match the entire input to succeed. Use lexy::dsl::eof if it should fail when it didn’t consume the entire input.

See also