Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
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
Please
log in
to post a comment.
success
Progress bar
Sorting algorithm comparison
Program_2
iota_30-Seconds-of-C++
Visual Studio C++ wont accept >> or << past the initial declarations
Template function declaration to avoid usage of template in T::template f<int>()
copy
Kare-Küp Tablosu
C++ Macro overload
Please log in to post a comment.