std::regex_...:regex_error(3)
π std::regex_...:regex_error(3) π
okay bestie, welcome to the C++ Standard Libary manual page for std::regex_error::regex_error β yes, that's the constructor for the regex error class, and it's lowkey the main character of this page. It literally has the same name twice because constructors love that for themselves. π
β¨ NAME β¨
std::regex_error::regex_error β std::regex_error::regex_error
no cap, that's the whole name. it's giving βI am my own twinβ but make it C++. π«Ά
π¦ Synopsis π¦
okay so it's defined in header <regex>, and both of these constructors have been here since C++11. here's the exact tea:
Defined in header <regex>
regex_error( std::regex_constants::error_type ecode ); (1) (since C++11)
regex_error( const regex_error& other ); (2) (since C++11)
- Constructs a
regex_errorwith a givenecodeof typestd::regex_constants::error_type. literally builds the error object from the code you pass in. π₯ - Copy constructor. Initializes the contents with those of
other. and if*thisandotherboth have dynamic typestd::regex_errorthenstd::strcmp(what(), other.what()) == 0β yes, that exact check, character for character. π
πΈ Parameters πΈ
ecodeβ error code indicating the error raised in regular expression parsing. it's the little sign that says what went wrong in regex land. πotherβ anotherregex_errorobject to copy. your classic copy-paste bestie. π
π See also π
error_typeβ describes different types of matching errors (C++11) (typedef). iconic little typedef behavior, honestly. π
π and that's the page, bestie! source: http://cppreference.com, version/date: 2024.06.10, page: std::regex_...:regex_error(3). go forth and construct your regex errors responsibly π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms