问题
I have the following string :
s = "server ('m1.labs.terada')ta.com') username ('user5') password('use r5') dbname ('default')";
I have defined a regex for extracting the values between the paranthesis,i.e m1.labs.terada')ta.com , user5.
regex re("\(\'[!-~]+\'\)");
sregex_token_iterator i(s.begin(), s.end(), re, 1);
sregex_token_iterator j;
However, I am not able to extract 'use r5'. Is there any way I can modify the regex to include white spaces as well?
来源:https://stackoverflow.com/questions/45180871/extracting-whitespaces-using-regex-in-cpp