发布网友
共4个回答
热心网友
正则表达式: \d{4}(?=\d{4}$)
替换字符串: ****
热心网友
这个问题不需要使用正则表达式吧
把这个数据倒序
然后影藏第5-8位数字就可以了
热心网友
[0-9]{19}
热心网友
#include<regex>
#include<string>
#include<iostream>
int main(){
std::string s{"567867760123445678"};
std::regex rgx("[\\d]{4}([\\d]{4})$");
auto ss=regex_replace(s,rgx,"****$1");
std::cout<<ss<<std::endl;
}