Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Regex success
#include <iostream> #include <regex> #include <string> int main() { std::string str = "Got event %s (%d) in state %s (%d), moving to state %s (%d)"; std::regex r = std::regex("^([^%]|%(\\.[0-9]+)?[a-zA-Z])*$", std::regex::extended); try { if (std::regex_match(str, r)) std::cout << "matched\n"; else std::cout << "not matched\n"; } catch (std::regex_error& rex) { std::cout << "Oops: " << rex.what() << "\n"; } return 0; }
run
|
edit
|
history
|
help
0
progrm_1
Not an overflow
Rounding in C++
timeConversion
Template float/int comparison
Static cast of Enum
asock
#26
Multiple inheritance of empty classes - sizeof
pi