Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
regex select, find
#include <iostream> #include <regex> using namespace std; int main() { string s = "<rule source=\"192.168.10.10:any\" destination=\"any:any\" protocol=\"UDP\"/>"; const regex r(".*\"(.*)\" destination.*"); smatch sm; string result; if (regex_search(s, sm, r)) result = sm[1]; cout << result << endl; // result = "192.168.10.10:any" return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Error with move capture of a const ref in a lambda function
Double_wrapper vc++
#22.2
parantheses matching test 1
Hangman
PreprocessorVsNamespace
define own struct
class with unique_ptr to vector
C string literal
base call virtual
Please log in to post a comment.