kaycxx-assert
C++ assertion library
Loading...
Searching...
No Matches
assert_not_match

Asserts that a string-like value does not fully match a regular expression.

The regex check is a full-value match. A value can still contain the pattern as a substring and pass this assertion when the complete value does not match.

#include <regex>
using namespace kaycxx::assert;
int main() {
assert_not_match("user-x", "user-[0-9]+");
auto numeric_id = std::regex{"[0-9]+"};
assert_not_match("id-42", numeric_id);
}
Includes the complete public assertion API.
Assertion functions and related types.
Definition assert.hpp:15

Null C string pointers do not match and therefore pass assert_not_match.