extracting whitespaces using regex in cpp

柔情痞子 提交于 2019-12-13 20:09:03

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!