Extract spaces using regex in cpp

I have the following line:

s = "server ('m1.labs.terada')ta.com') username ('user5') password('use r5') dbname ('default')"; 

I have defined a regex to extract values ​​between paths, 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 cannot extract 'use r5'. Is there a way to change the regex to include spaces in it?

0
source share

Source: https://habr.com/ru/post/1270133/


All Articles