简体   繁体   中英

Replace extraspaces of a string after pattern matching using rwcrexpr in C++

I have a string like below

std::string = "S.ID="1234" S.NAME="Sachin"    S.NICKNAME="God  of  cricket" S.CITY="MUMBAI";

I need to replace each extra spaces after the pattern ="*" with a single space using RWCRexpr

Any help on this?

The regular expression \\s*=\\s*"\\[^\\"\\]*"(\\s{2,}) will match your extra spaces.

Hovewer, according to the online documentation, RWCRexpr is deprecated and your should use RWTRegex<T> instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM